diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index 4bf9abf12..da4009c91 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -7,7 +7,7 @@ on: env: GO_VERSION: 1.17 - GOLANGCI_LINT_VERSION: v1.41.1 + GOLANGCI_LINT_VERSION: v1.42.1 MISSSPELL_VERSION: v0.3.4 PRE_TARGET: "" diff --git a/.golangci.toml b/.golangci.toml index 4ce89734e..9caed7360 100644 --- a/.golangci.toml +++ b/.golangci.toml @@ -16,9 +16,6 @@ [linters-settings.gocyclo] min-complexity = 14.0 - [linters-settings.maligned] - suggest-new = true - [linters-settings.goconst] min-len = 3.0 min-occurrences = 4.0 diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 0210c1ffa..30d7cd1f5 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -25,7 +25,7 @@ global_job_config: - export "PATH=${GOPATH}/bin:${PATH}" - mkdir -vp "${SEMAPHORE_GIT_DIR}" "${GOPATH}/bin" - export GOPROXY=https://proxy.golang.org,direct - - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${GOPATH}/bin" v1.41.1 + - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${GOPATH}/bin" v1.42.1 - curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | bash -s -- -b "${GOPATH}/bin" - go install github.com/containous/go-bindata/go-bindata@v1.0.0 - checkout diff --git a/build.Dockerfile b/build.Dockerfile index cd9c84c98..30cc0056f 100644 --- a/build.Dockerfile +++ b/build.Dockerfile @@ -19,7 +19,7 @@ RUN mkdir -p /usr/local/bin \ && chmod +x /usr/local/bin/go-bindata # Download golangci-lint binary to bin folder in $GOPATH -RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.41.1 +RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.42.1 # Download misspell binary to bin folder in $GOPATH RUN curl -sfL https://raw.githubusercontent.com/client9/misspell/master/install-misspell.sh | bash -s -- -b $GOPATH/bin v0.3.4 diff --git a/cmd/internal/gen/centrifuge.go b/cmd/internal/gen/centrifuge.go index ddef63429..bb58f9c19 100644 --- a/cmd/internal/gen/centrifuge.go +++ b/cmd/internal/gen/centrifuge.go @@ -258,7 +258,7 @@ type fileWriter struct { } func (f fileWriter) Write(files map[string]*File) error { - err := os.MkdirAll(f.baseDir, 0755) + err := os.MkdirAll(f.baseDir, 0o755) if err != nil { return err } diff --git a/cmd/internal/gen/main.go b/cmd/internal/gen/main.go index fb0b95773..add14c44b 100644 --- a/cmd/internal/gen/main.go +++ b/cmd/internal/gen/main.go @@ -83,7 +83,7 @@ func run(dest string) error { return err } - return ioutil.WriteFile(filepath.Join(dest, "marshaler.go"), []byte(fmt.Sprintf(marsh, destPkg)), 0666) + return ioutil.WriteFile(filepath.Join(dest, "marshaler.go"), []byte(fmt.Sprintf(marsh, destPkg)), 0o666) } func cleanType(typ types.Type, base string) string { diff --git a/integration/log_rotation_test.go b/integration/log_rotation_test.go index 2fe27d78b..cc0e027d4 100644 --- a/integration/log_rotation_test.go +++ b/integration/log_rotation_test.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package integration diff --git a/pkg/anonymize/anonymize_config_test.go b/pkg/anonymize/anonymize_config_test.go index 8a1133fca..941fef1b6 100644 --- a/pkg/anonymize/anonymize_config_test.go +++ b/pkg/anonymize/anonymize_config_test.go @@ -468,7 +468,7 @@ func TestDo_dynamicConfiguration(t *testing.T) { require.NoError(t, err) if *updateExpected { - require.NoError(t, os.WriteFile("testdata/anonymized-dynamic-config.json", []byte(cleanJSON), 0666)) + require.NoError(t, os.WriteFile("testdata/anonymized-dynamic-config.json", []byte(cleanJSON), 0o666)) } expected := strings.TrimSuffix(string(expectedConfiguration), "\n") @@ -975,7 +975,7 @@ func TestDo_staticConfiguration(t *testing.T) { require.NoError(t, err) if *updateExpected { - require.NoError(t, os.WriteFile("testdata/anonymized-static-config.json", []byte(cleanJSON), 0666)) + require.NoError(t, os.WriteFile("testdata/anonymized-static-config.json", []byte(cleanJSON), 0o666)) } expected := strings.TrimSuffix(string(expectedConfiguration), "\n") diff --git a/pkg/provider/acme/local_store_unix.go b/pkg/provider/acme/local_store_unix.go index 35c3d24bd..f6d590536 100644 --- a/pkg/provider/acme/local_store_unix.go +++ b/pkg/provider/acme/local_store_unix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package acme diff --git a/pkg/server/server_signals.go b/pkg/server/server_signals.go index 3b5adca59..d1ad8d51a 100644 --- a/pkg/server/server_signals.go +++ b/pkg/server/server_signals.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package server