From f84ffa3019590f441fdfc935f112e3c7f049b6fc Mon Sep 17 00:00:00 2001 From: Jimmi Dyson Date: Mon, 9 May 2022 15:14:13 +0100 Subject: [PATCH] feat: go v1.18 (#110) --- .github/workflows/checks.yml | 2 +- .golangci.yml | 1 + .tool-versions | 4 ++-- go.mod | 2 +- skopeo-static/go.mod | 2 +- skopeo/skopeo.go | 9 +++++---- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 1979f601..aa141bd5 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -42,7 +42,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: '1.17' + go-version: '1.18' check-latest: true - name: Check out code diff --git a/.golangci.yml b/.golangci.yml index 111783bb..8060b283 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -3,6 +3,7 @@ run: timeout: 3m + go: '1.17' linters: disable-all: true diff --git a/.tool-versions b/.tool-versions index 0e30612d..9167b918 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,6 +1,6 @@ -golangci-lint 1.45.2 +golangci-lint 1.46.0 goreleaser 1.8.3 -golang 1.17.9 # FREEZE until golangci-lint fully supports go 1.18 +golang 1.18.1 helm 3.8.1 pre-commit 2.19.0 upx 3.96 diff --git a/go.mod b/go.mod index 49ab8ae4..3ca8f3f2 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/mesosphere/mindthegap -go 1.17 +go 1.18 require ( github.com/aws/aws-sdk-go-v2/config v1.15.4 diff --git a/skopeo-static/go.mod b/skopeo-static/go.mod index 029a9b48..880ee568 100644 --- a/skopeo-static/go.mod +++ b/skopeo-static/go.mod @@ -3,7 +3,7 @@ module github.com/mesosphere/mindthegap/skopeo-static -go 1.17 +go 1.18 require github.com/containers/skopeo v1.8.0 diff --git a/skopeo/skopeo.go b/skopeo/skopeo.go index 282f779d..dbdfd1a5 100644 --- a/skopeo/skopeo.go +++ b/skopeo/skopeo.go @@ -238,13 +238,14 @@ func (r *Runner) CopyManifest( mf, err := os.Create(filepath.Join(td, "manifest.json")) if err != nil { - return nil, nil, fmt.Errorf("failed to create manifest.jsin file: %w", err) + return nil, nil, fmt.Errorf("failed to create manifest.json file: %w", err) } defer mf.Close() - // No need to check error - safe to enscode this type. See https://github.com/breml/errchkjson#safe - // for details - _ = json.NewEncoder(mf).Encode(manifest) + err = json.NewEncoder(mf).Encode(manifest) + if err != nil { + return nil, nil, fmt.Errorf("failed to JSON encode manifest: %w", err) + } return r.Copy( ctx,