From c39a9d50b7b372e835d375120fc62989956f43e3 Mon Sep 17 00:00:00 2001 From: Matt Ouille Date: Fri, 27 Sep 2024 21:46:32 -0700 Subject: [PATCH 1/9] Upgrade to Go 1.22 toolchain --- .github/workflows/goreleaser.yml | 2 +- Dockerfile.test | 2 +- appveyor.yml | 2 +- cmd/proxy/Dockerfile | 2 +- docker-compose.yml | 6 +++--- go.mod | 2 +- go.sum | 11 +++++++++++ scripts/build-image/Dockerfile | 2 +- 8 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 6ff252a8d..ee208df95 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -14,7 +14,7 @@ jobs: - name: setup-go uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.22" - name: capture current date id: date run: echo "::set-output name=date::$(date -u '+%Y-%m-%d-%H:%M:%S-%Z')" diff --git a/Dockerfile.test b/Dockerfile.test index fc205e3fa..8141c7254 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -1,4 +1,4 @@ -ARG GOLANG_VERSION=1.20 +ARG GOLANG_VERSION=1.22 FROM golang:$GOLANG_VERSION RUN echo $GOLANG_VERSION diff --git a/appveyor.yml b/appveyor.yml index 6ae53ddf5..f58325e2f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,7 +10,7 @@ environment: GOPROXY: https://proxy.golang.org SKIP_UNTIL_113: true -stack: go 1.20 +stack: go 1.22 test_script: - go version diff --git a/cmd/proxy/Dockerfile b/cmd/proxy/Dockerfile index 7a33221cc..2c52b0683 100644 --- a/cmd/proxy/Dockerfile +++ b/cmd/proxy/Dockerfile @@ -5,7 +5,7 @@ # You can override the Go version used to build the image. # See project Makefile if using make. # See docker --build-arg if building directly. -ARG GOLANG_VERSION=1.20 +ARG GOLANG_VERSION=1.22 ARG ALPINE_VERSION=3.17 FROM golang:${GOLANG_VERSION}-alpine AS builder diff --git a/docker-compose.yml b/docker-compose.yml index b86946afc..de7afed80 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: context: . dockerfile: cmd/proxy/Dockerfile args: - GOLANG_VERSION: "1.20" + GOLANG_VERSION: "1.22" environment: - ATHENS_MONGO_STORAGE_URL=mongodb://mongo:27017 - TIMEOUT=20 # in case the mongo dependency takes longer to start up @@ -20,7 +20,7 @@ services: context: . dockerfile: Dockerfile.test args: - GOLANG_VERSION: "1.20" + GOLANG_VERSION: "1.22" command: ["./scripts/test_unit.sh"] environment: - GO_ENV=test @@ -36,7 +36,7 @@ services: context: . dockerfile: Dockerfile.test args: - GOLANG_VERSION: "1.20" + GOLANG_VERSION: "1.22" command: ["./scripts/test_e2e.sh"] azurite: image: arafato/azurite:2.6.5 diff --git a/go.mod b/go.mod index c819e0651..00a45ced3 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/gomods/athens -go 1.20 +go 1.22 require ( cloud.google.com/go/storage v1.36.0 diff --git a/go.sum b/go.sum index a53844743..51e1cbbbc 100644 --- a/go.sum +++ b/go.sum @@ -167,7 +167,9 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101 h1:7To3pQ+pZo0i3dsWEbinPNFs5gPSBOsJtx3wTT94VBY= +github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v1.0.2 h1:H9MtNqVoVhvd9nCBwOyDjUEdZCREqbIdCJD93PBm/jA= +github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= @@ -188,6 +190,7 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= +github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= @@ -209,6 +212,7 @@ github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ4 github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= @@ -318,6 +322,7 @@ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXi github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -408,9 +413,11 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxv github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= @@ -609,6 +616,7 @@ go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7e go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= @@ -878,11 +886,13 @@ golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -995,6 +1005,7 @@ gopkg.in/DataDog/dd-trace-go.v1 v1.10.0/go.mod h1:DVp8HmDh8PuTu2Z0fVVlBsyWaC++fz gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= diff --git a/scripts/build-image/Dockerfile b/scripts/build-image/Dockerfile index f462a39df..1c501e4eb 100644 --- a/scripts/build-image/Dockerfile +++ b/scripts/build-image/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.20-bullseye +FROM golang:1.22-bullseye WORKDIR /tmp From 051c70f00b3bd88e4c4911be01814f89df4c6c89 Mon Sep 17 00:00:00 2001 From: Matt Ouille Date: Fri, 27 Sep 2024 21:59:59 -0700 Subject: [PATCH 2/9] Fix deprecated options --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f27b80e8d..64ed7206d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,8 +24,7 @@ jobs: uses: golangci/golangci-lint-action@v6 with: version: ${{ env.GOLANGCI_LINT_VERSION }} - skip-pkg-cache: true - skip-build-cache: true + skip-cache: true build: env: From 992b07485499736df8d3dad2e97fadeb55b59974 Mon Sep 17 00:00:00 2001 From: Matt Ouille Date: Fri, 27 Sep 2024 22:08:29 -0700 Subject: [PATCH 3/9] Remove option --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64ed7206d..d5cd0fdde 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,6 @@ jobs: uses: golangci/golangci-lint-action@v6 with: version: ${{ env.GOLANGCI_LINT_VERSION }} - skip-cache: true build: env: From 14b948107699380b8732d140e21a990473ff8945 Mon Sep 17 00:00:00 2001 From: Matt Ouille Date: Fri, 27 Sep 2024 22:23:42 -0700 Subject: [PATCH 4/9] Upgrade golangci-lint --- .github/workflows/ci.yml | 2 +- .golangci.yml | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5cd0fdde..47f3e4c7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: lint: runs-on: ubuntu-latest env: - GOLANGCI_LINT_VERSION: v1.51.2 + GOLANGCI_LINT_VERSION: v1.61.0 steps: - uses: actions/checkout@v4 diff --git a/.golangci.yml b/.golangci.yml index 3111c62b3..07667d1c5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -16,18 +16,17 @@ linters-settings: linters: enable-all: true disable: - - interfacer # deprecated - - scopelint # deprecated - - maligned # deprecated - - golint # deprecated - - structcheck # deprecated - - deadcode # deprecated - - varcheck # deprecated - - nosnakecase # deprecated - - ifshort # deprecated + - perfsprint # new + - testifylint # new + - spancheck # new + - rowserrcheck # new + - mnd # new + - intrange # new + - depguard # new + - revive # new + - errcheck # new - errchkjson - exhaustive - - exhaustivestruct - exhaustruct - forcetypeassert - funlen @@ -35,7 +34,7 @@ linters: - gochecknoinits - goconst - godox - - goerr113 + - err113 - gomnd - ireturn - lll @@ -60,6 +59,7 @@ issues: - "G204: Subprocess launched with variable" - "G402: TLS MinVersion too low." - "const `op` is unused" + - "G115: integer overflow conversion int -> int32" exclude-rules: - path: cmd/proxy/main.go text: "G108: Profiling endpoint is automatically exposed on /debug/pprof" From 15a09dd5312fc255111ee1bb83120aa1b4f37cae Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 27 Sep 2024 22:26:26 -0700 Subject: [PATCH 5/9] Update .github/workflows/goreleaser.yml Co-authored-by: Nicholas Wiersma --- .github/workflows/goreleaser.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index ee208df95..97c98fb6e 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -14,7 +14,7 @@ jobs: - name: setup-go uses: actions/setup-go@v5 with: - go-version: "1.22" + go-version-file: 'go.mod' - name: capture current date id: date run: echo "::set-output name=date::$(date -u '+%Y-%m-%d-%H:%M:%S-%Z')" From 2ac0dc9cb6758296858593ae45addd5e814e5b85 Mon Sep 17 00:00:00 2001 From: Matt Ouille Date: Fri, 27 Sep 2024 22:30:39 -0700 Subject: [PATCH 6/9] Disable additional linters --- .golangci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index 07667d1c5..ca81b28a4 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -28,6 +28,8 @@ linters: - errchkjson - exhaustive - exhaustruct + - execinquery + - exportloopref - forcetypeassert - funlen - gochecknoglobals From 1b69b68b5617eaa63da876a325d62b8862c3fc8d Mon Sep 17 00:00:00 2001 From: Matt Ouille Date: Fri, 27 Sep 2024 22:40:45 -0700 Subject: [PATCH 7/9] Fix linting --- pkg/storage/compliance/benchmarks.go | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/pkg/storage/compliance/benchmarks.go b/pkg/storage/compliance/benchmarks.go index b3325dd58..05b4a6218 100644 --- a/pkg/storage/compliance/benchmarks.go +++ b/pkg/storage/compliance/benchmarks.go @@ -13,16 +13,18 @@ import ( // RunBenchmarks takes a backend and runs benchmarks against // saving and loading modules. -func RunBenchmarks(b *testing.B, s storage.Backend, clear func() error) { - benchList(b, s, clear) - benchSave(b, s, clear) - benchDelete(b, s, clear) - benchExists(b, s, clear) +func RunBenchmarks(b *testing.B, s storage.Backend, reset func() error) { + b.Helper() + benchList(b, s, reset) + benchSave(b, s, reset) + benchDelete(b, s, reset) + benchExists(b, s, reset) } -func benchList(b *testing.B, s storage.Backend, clear func() error) { - require.NoError(b, clear()) - defer require.NoError(b, clear()) +func benchList(b *testing.B, s storage.Backend, reset func() error) { + b.Helper() + require.NoError(b, reset()) + defer require.NoError(b, reset()) module, version := "benchListModule", "1.0.1" mock := getMockModule() err := s.Save( @@ -43,9 +45,10 @@ func benchList(b *testing.B, s storage.Backend, clear func() error) { }) } -func benchSave(b *testing.B, s storage.Backend, clear func() error) { - require.NoError(b, clear()) - defer require.NoError(b, clear()) +func benchSave(b *testing.B, s storage.Backend, reset func() error) { + b.Helper() + require.NoError(b, reset()) + defer require.NoError(b, reset()) module, version := "benchSaveModule", "1.0.1" mock := getMockModule() From eda1ed89f56c2a4bda2e63401a4886366dae4d03 Mon Sep 17 00:00:00 2001 From: Matt Ouille Date: Fri, 27 Sep 2024 22:40:54 -0700 Subject: [PATCH 8/9] Disable more linters --- .golangci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index ca81b28a4..28e1c7107 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -28,8 +28,8 @@ linters: - errchkjson - exhaustive - exhaustruct - - execinquery - - exportloopref + - execinquery # deprecated + - exportloopref # deprecated - forcetypeassert - funlen - gochecknoglobals From bbb9c6bcfb360bfc4b66f1a98781f0f65f5d7f98 Mon Sep 17 00:00:00 2001 From: Matt Ouille Date: Fri, 27 Sep 2024 22:42:43 -0700 Subject: [PATCH 9/9] Fix more linting --- pkg/storage/compliance/benchmarks.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/storage/compliance/benchmarks.go b/pkg/storage/compliance/benchmarks.go index 05b4a6218..390dada71 100644 --- a/pkg/storage/compliance/benchmarks.go +++ b/pkg/storage/compliance/benchmarks.go @@ -73,9 +73,10 @@ func benchSave(b *testing.B, s storage.Backend, reset func() error) { }) } -func benchDelete(b *testing.B, s storage.Backend, clear func() error) { - require.NoError(b, clear()) - defer require.NoError(b, clear()) +func benchDelete(b *testing.B, s storage.Backend, reset func() error) { + b.Helper() + require.NoError(b, reset()) + defer require.NoError(b, reset()) module, version := "benchDeleteModule", "1.0.1" mock := getMockModule() @@ -94,9 +95,10 @@ func benchDelete(b *testing.B, s storage.Backend, clear func() error) { }) } -func benchExists(b *testing.B, s storage.Backend, clear func() error) { - require.NoError(b, clear()) - defer require.NoError(b, clear()) +func benchExists(b *testing.B, s storage.Backend, reset func() error) { + b.Helper() + require.NoError(b, reset()) + defer require.NoError(b, reset()) module, version := "benchExistsModule", "1.0.1" mock := getMockModule()