chore: upgrade linter

This commit is contained in:
Ludovic Fernandez 2021-09-16 09:16:07 +02:00 committed by GitHub
parent 6e28db513c
commit 6f4a7fb604
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 10 additions and 10 deletions

View file

@ -7,7 +7,7 @@ on:
env: env:
GO_VERSION: 1.17 GO_VERSION: 1.17
GOLANGCI_LINT_VERSION: v1.41.1 GOLANGCI_LINT_VERSION: v1.42.1
MISSSPELL_VERSION: v0.3.4 MISSSPELL_VERSION: v0.3.4
PRE_TARGET: "" PRE_TARGET: ""

View file

@ -16,9 +16,6 @@
[linters-settings.gocyclo] [linters-settings.gocyclo]
min-complexity = 14.0 min-complexity = 14.0
[linters-settings.maligned]
suggest-new = true
[linters-settings.goconst] [linters-settings.goconst]
min-len = 3.0 min-len = 3.0
min-occurrences = 4.0 min-occurrences = 4.0

View file

@ -25,7 +25,7 @@ global_job_config:
- export "PATH=${GOPATH}/bin:${PATH}" - export "PATH=${GOPATH}/bin:${PATH}"
- mkdir -vp "${SEMAPHORE_GIT_DIR}" "${GOPATH}/bin" - mkdir -vp "${SEMAPHORE_GIT_DIR}" "${GOPATH}/bin"
- export GOPROXY=https://proxy.golang.org,direct - 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" - 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 - go install github.com/containous/go-bindata/go-bindata@v1.0.0
- checkout - checkout

View file

@ -19,7 +19,7 @@ RUN mkdir -p /usr/local/bin \
&& chmod +x /usr/local/bin/go-bindata && chmod +x /usr/local/bin/go-bindata
# Download golangci-lint binary to bin folder in $GOPATH # 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 # 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 RUN curl -sfL https://raw.githubusercontent.com/client9/misspell/master/install-misspell.sh | bash -s -- -b $GOPATH/bin v0.3.4

View file

@ -258,7 +258,7 @@ type fileWriter struct {
} }
func (f fileWriter) Write(files map[string]*File) error { func (f fileWriter) Write(files map[string]*File) error {
err := os.MkdirAll(f.baseDir, 0755) err := os.MkdirAll(f.baseDir, 0o755)
if err != nil { if err != nil {
return err return err
} }

View file

@ -83,7 +83,7 @@ func run(dest string) error {
return err 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 { func cleanType(typ types.Type, base string) string {

View file

@ -1,3 +1,4 @@
//go:build !windows
// +build !windows // +build !windows
package integration package integration

View file

@ -468,7 +468,7 @@ func TestDo_dynamicConfiguration(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
if *updateExpected { 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") expected := strings.TrimSuffix(string(expectedConfiguration), "\n")
@ -975,7 +975,7 @@ func TestDo_staticConfiguration(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
if *updateExpected { 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") expected := strings.TrimSuffix(string(expectedConfiguration), "\n")

View file

@ -1,3 +1,4 @@
//go:build !windows
// +build !windows // +build !windows
package acme package acme

View file

@ -1,3 +1,4 @@
//go:build !windows
// +build !windows // +build !windows
package server package server