From 8829d3b7cc3260474ceec2f7b4592ae430ad0c74 Mon Sep 17 00:00:00 2001 From: Lize Cai Date: Thu, 24 Oct 2024 19:27:36 +0800 Subject: [PATCH] feat: add go 1.22 build (#764) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add go 1.22 build support to fix some vulnerabilities. --------- Signed-off-by: Lize Cai Co-authored-by: İbrahim Güngör --- .github/workflows/ci.yml | 8 ++++++-- .github/workflows/goreleaser.yml | 4 ++-- Dockerfile | 4 ++-- e2e/run_test.go | 1 - go.mod | 2 +- storage/s3.go | 2 +- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f36d6b6b..eceb7f72f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,8 +11,9 @@ jobs: strategy: matrix: go-version: + - 1.22.x + - 1.21.x - 1.20.x - - 1.19.x os: - macos - ubuntu @@ -32,8 +33,9 @@ jobs: strategy: matrix: go-version: + - 1.22.x + - 1.21.x - 1.20.x - - 1.19.x os: - macos - ubuntu @@ -67,6 +69,8 @@ jobs: strategy: matrix: go-version: + - 1.22.x + - 1.21.x - 1.20.x os: - ubuntu diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index fa7af6362..56a75b477 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: 1.20.x + go-version: 1.22.x - run: make test_without_race env: S5CMD_ACCESS_KEY_ID: ${{ secrets.S5CMD_GCS_ACCESS_KEY_ID }} @@ -34,7 +34,7 @@ jobs: name: Set up Go uses: actions/setup-go@v2 with: - go-version: '1.20' + go-version: '1.22' - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 diff --git a/Dockerfile b/Dockerfile index a56bfdb51..0320c5cbb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ -FROM golang:1.20-alpine as build +FROM golang:1.22-alpine AS build COPY . /s5cmd/ RUN apk add --no-cache git make && \ cd /s5cmd/ && \ CGO_ENABLED=0 make build -FROM alpine:3.18 +FROM alpine:3.20 COPY --from=build /s5cmd/s5cmd . WORKDIR /aws ENTRYPOINT ["/s5cmd"] diff --git a/e2e/run_test.go b/e2e/run_test.go index 16d61d387..f54d16df0 100644 --- a/e2e/run_test.go +++ b/e2e/run_test.go @@ -263,7 +263,6 @@ func TestRunSpecialCharactersInPrefix(t *testing.T) { defer file.Remove() cmd := s5cmd("run", file.Path()) - cmd.Timeout = time.Second result := icmd.RunCmd(cmd) result.Assert(t, icmd.Success) diff --git a/go.mod b/go.mod index 2c193acd0..e78da34d4 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/peak/s5cmd/v2 -go 1.19 +go 1.20 require ( github.com/aws/aws-sdk-go v1.44.298 diff --git a/storage/s3.go b/storage/s3.go index 7c85468ca..3313be66e 100644 --- a/storage/s3.go +++ b/storage/s3.go @@ -1049,7 +1049,7 @@ func (s *S3) doDelete(ctx context.Context, chunk chunk, resultch chan *Object) { resultch <- &Object{ URL: url, - Err: fmt.Errorf(aws.StringValue(e.Message)), + Err: fmt.Errorf("%v", aws.StringValue(e.Message)), } } }