diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36d27f9..49a5d77 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,10 +11,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: set up go 1.20 + - name: set up go 1.22 uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.22" id: go - name: checkout @@ -32,7 +32,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: latest + version: 1.61 - name: install goveralls run: go install github.com/mattn/goveralls@latest diff --git a/.golangci.yml b/.golangci.yml index 192d484..c90a028 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,6 @@ linters-settings: govet: - check-shadowing: true + shadow: true golint: min-confidence: 0.6 gocyclo: @@ -29,18 +29,17 @@ linters-settings: linters: disable-all: true enable: - - megacheck - revive - govet - unconvert - - gas - - misspell + - gosec + - unparam - unused - typecheck - ineffassign - stylecheck - gochecknoinits - - exportloopref + - gocritic - nakedret - gosimple - prealloc @@ -49,12 +48,11 @@ linters: run: - # modules-download-mode: vendor - skip-dirs: - - vendor concurrency: 4 issues: + exclude-dirs: + - vendor exclude-rules: - text: "should have a package comment, unless it's in another file for this package" linters: @@ -71,13 +69,35 @@ issues: - text: "weak cryptographic primitive" linters: - gosec + - text: "integer overflow conversion" + linters: + - gosec + - text: "should have a package comment" + linters: + - revive - text: "at least one file in a package should have a package comment" linters: - stylecheck - - text: "should have a package comment" + - text: "commentedOutCode: may want to remove commented-out code" + linters: + - gocritic + - text: "unnamedResult: consider giving a name to these results" + linters: + - gocritic + - text: "var-naming: don't use an underscore in package name" linters: - revive - - text: 'Deferring unsafe method "Close" on type "io.ReadCloser"' + - text: "should not use underscores in package names" linters: - - gosec + - stylecheck + - text: "struct literal uses unkeyed fields" + linters: + - govet + - linters: + - unparam + - unused + - revive + path: _test\.go$ + text: "unused-parameter" exclude-use-default: false +