diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml index b81b979..c335294 100644 --- a/.github/workflows/pr-check.yaml +++ b/.github/workflows/pr-check.yaml @@ -87,7 +87,7 @@ jobs: - name: Run golangci lint uses: golangci/golangci-lint-action@38e1018663fa5173f3968ea0777460d3de38f256 with: - version: v1.53.3 + version: v1.58.1 # use our .golangci.yml and configure output to be logged in the GHA, # in addition to annotating the commit. see # https://github.com/golangci/golangci-lint-action/issues/119#issuecomment-981090648 diff --git a/.golangci.yml b/.golangci.yml index 636fbc5..718e77b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -12,13 +12,15 @@ linters: - bodyclose - containedctx - contextcheck + - copyloopvar - decorder - dogsled - dupl - dupword - durationcheck - - errchkjson + - err113 - errcheck + - errchkjson - errname - errorlint - exhaustive @@ -29,18 +31,18 @@ linters: - goconst - gocritic - godot - - goerr113 - gofmt - goheader - goimports - - gomnd - goprintffuncname - gosec - gosimple - govet - grouper + - importas - ineffassign - interfacebloat + - intrange - ireturn - makezero - mirror @@ -51,14 +53,17 @@ linters: - nilerr - noctx - nosprintfhostport + - perfsprint - prealloc - predeclared - reassign - revive - rowserrcheck + - sloglint - staticcheck - tagalign - tenv + - testifylint - thelper - tparallel - typecheck @@ -87,5 +92,5 @@ linters-settings: issues: exclude-use-default: false # default rules exclude doc comments check :( exclude-rules: - - linters: [goerr113] + - linters: [err113] text: "do not define dynamic errors, use wrapped static errors instead" diff --git a/ioreadall/io_readall.go b/ioreadall/io_readall.go index 8d2c316..f6a0777 100644 --- a/ioreadall/io_readall.go +++ b/ioreadall/io_readall.go @@ -4,6 +4,7 @@ package ioreadall import ( + "errors" "fmt" "go/ast" "strings" @@ -38,7 +39,7 @@ func init() { func run(pass *analysis.Pass) (interface{}, error) { inspct, ok := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) if !ok { - return nil, fmt.Errorf("analyzer is not type *inspector.Inspector") + return nil, errors.New("analyzer is not type *inspector.Inspector") } ignoreMap := make(map[string]struct{}) diff --git a/timeafter/time_after.go b/timeafter/time_after.go index 9e7df49..9112739 100644 --- a/timeafter/time_after.go +++ b/timeafter/time_after.go @@ -4,6 +4,7 @@ package timeafter import ( + "errors" "fmt" "go/ast" "strings" @@ -46,7 +47,7 @@ func (v visitor) Visit(node ast.Node) ast.Visitor { func run(pass *analysis.Pass) (interface{}, error) { inspct, ok := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) if !ok { - return nil, fmt.Errorf("analyzer is not type *inspector.Inspector") + return nil, errors.New("analyzer is not type *inspector.Inspector") } ignoreMap := make(map[string]struct{})