diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ae2fd7b..42c0321a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,12 @@ parameters: # override it in any parameterized builds, but just as a convenient shareable constant go-release-version: type: string - default: "1.19.4" + default: "1.20.1" + + # In addition to the most recent version of Go, we also support the previous version. + go-previous-version: + type: string + default: "1.19.6" # We use a remote Docker host in some CI jobs that need to run Docker containers. # As of 2022-04-15, the default Docker daemon version was 17.09.0-ce, which started @@ -31,23 +36,15 @@ workflows: workflow: jobs: - go-test: - name: Go latest - # This build has a deliberately unpinned version so that if a new Go major version - # is released before we have updated the build, we can detect any problems early - docker-image: circleci/golang:latest - - go-test: - name: Go 1.19 - docker-image: cimg/go:1.19 + name: Go <> + docker-image: cimg/go:<> run-lint: true test-coverage: true - go-test: - name: Go 1.18 - docker-image: cimg/go:1.18 - - go-test: - name: Go 1.17 - docker-image: cimg/go:1.17 + name: Go <> + docker-image: cimg/go:<> - benchmarks: - docker-image: cimg/go:1.19 + docker-image: cimg/go:<> - integration-test - docker-images-test @@ -89,13 +86,11 @@ workflows: only: v6 jobs: - package-build-test: - name: package build - Go latest - docker-image: circleci/golang:latest - use-go-install: true + name: package build - Go <> + docker-image: cimg/go:<> - package-build-test: - name: package build - Go 1.17 - docker-image: cimg/go:1.17 - use-go-install: true + name: package build - Go <> + docker-image: cimg/go:<> daily-security-scan: triggers: @@ -233,22 +228,12 @@ jobs: parameters: docker-image: type: string - use-go-install: - type: boolean - docker: - image: <> steps: - run: go version - - when: - condition: <> - steps: - - run: go install github.com/launchdarkly/ld-relay/v6@latest - - unless: - condition: <> - steps: - - run: GO111MODULE=on go get github.com/launchdarkly/ld-relay/v6@latest + - run: go install github.com/launchdarkly/ld-relay/v6@latest - run: name: verify that executable was built command: ls -l $GOPATH/bin/ld-relay diff --git a/.golangci.yml b/.golangci.yml index 633bcd59..6509d3dc 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -7,7 +7,6 @@ run: linters: enable: - bodyclose - - deadcode - depguard - dupl - errcheck @@ -36,7 +35,6 @@ linters: - unconvert - unparam - unused - - varcheck - whitespace fast: false diff --git a/.ldrelease/config.yml b/.ldrelease/config.yml index 45657238..63fb4b48 100644 --- a/.ldrelease/config.yml +++ b/.ldrelease/config.yml @@ -38,7 +38,7 @@ repo: jobs: - docker: - image: cimg/go:1.19.4 # See "Runtime platform versions" in CONTRIBUTING.md + image: cimg/go:1.20.1 # See "Runtime platform versions" in CONTRIBUTING.md copyGitHistory: true template: name: go diff --git a/Dockerfile b/Dockerfile index 8f4149d9..7e8d72fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # This is a standalone Dockerfile that does not depend on goreleaser building the binary # It is NOT the version that is pushed to dockerhub -FROM golang:1.19.4-alpine3.16 as builder +FROM golang:1.20.1-alpine3.16 as builder # See "Runtime platform versions" in CONTRIBUTING.md RUN apk --no-cache add \ diff --git a/Makefile b/Makefile index 4b16cc75..07a53432 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -GOLANGCI_LINT_VERSION=v1.48.0 +GOLANGCI_LINT_VERSION=v1.51.2 LINTER=./bin/golangci-lint LINTER_VERSION_FILE=./bin/.golangci-lint-version-$(GOLANGCI_LINT_VERSION) diff --git a/go.mod b/go.mod index 33bb2ffa..91ecdb95 100644 --- a/go.mod +++ b/go.mod @@ -97,10 +97,10 @@ require ( go.opentelemetry.io/otel/metric v0.19.0 // indirect go.opentelemetry.io/otel/trace v0.19.0 // indirect golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect - golang.org/x/net v0.4.0 // indirect; override to address CVE-2022-41717 + golang.org/x/net v0.7.0 // indirect; override to address CVE-2022-41723 golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c // indirect - golang.org/x/sys v0.3.0 // indirect - golang.org/x/text v0.5.0 // indirect + golang.org/x/sys v0.5.0 // indirect + golang.org/x/text v0.7.0 // indirect google.golang.org/api v0.37.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506 // indirect diff --git a/go.sum b/go.sum index 4450f0e8..42520d5d 100644 --- a/go.sum +++ b/go.sum @@ -552,8 +552,8 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= -golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -637,11 +637,11 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -651,8 +651,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= -golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/internal/core/bigsegments/sync.go b/internal/core/bigsegments/sync.go index 29108e2e..f1aa2aea 100644 --- a/internal/core/bigsegments/sync.go +++ b/internal/core/bigsegments/sync.go @@ -323,7 +323,7 @@ func (s *defaultBigSegmentSynchronizer) poll() (bool, segmentChangesSummary, err if err != nil { return false, segmentChangesSummary{}, err } - defer response.Body.Close() //nolint:errcheck + defer response.Body.Close() //nolint:errcheck,gosec if response.StatusCode != 200 { return false, segmentChangesSummary{}, &httpStatusError{response.StatusCode} diff --git a/internal/core/sharedtest/listener.go b/internal/core/sharedtest/listener.go index b67efe62..716b36ca 100644 --- a/internal/core/sharedtest/listener.go +++ b/internal/core/sharedtest/listener.go @@ -13,7 +13,7 @@ import ( // and the port number, and then closes the listener. func WithListenerForAnyPort(t *testing.T, fn func(net.Listener, int)) { l, port := startListenerForAnyAvailablePort(t) - defer l.Close() //nolint:errcheck + defer l.Close() //nolint:errcheck,gosec fn(l, port) } diff --git a/scripts/verify-release-versions.sh b/scripts/verify-release-versions.sh index 36e1e331..4800be2e 100755 --- a/scripts/verify-release-versions.sh +++ b/scripts/verify-release-versions.sh @@ -21,7 +21,7 @@ function fail_for_file() { exit 1 } -LDRELEASE_GO_VERSION=$(sed <${ldrelease_config_file} -n 's#.*image: *cimg/go:\([1-9.]*\).*#\1#p') +LDRELEASE_GO_VERSION=$(sed <${ldrelease_config_file} -n 's#.*image: *cimg/go:\([0-9.]*\).*#\1#p') if [ -z "${LDRELEASE_GO_VERSION}" ]; then fail_for_file Go ${ldrelease_config_file} fi