diff --git a/.github/workflows/golang-ci.yml b/.github/workflows/golang-ci.yml index 64c9974..3dec9ee 100644 --- a/.github/workflows/golang-ci.yml +++ b/.github/workflows/golang-ci.yml @@ -30,7 +30,7 @@ jobs: lint: runs-on: ubuntu-latest container: - image: golangci/golangci-lint:v1.52.0 + image: golangci/golangci-lint:v1.58.1 steps: - name: checkout uses: actions/checkout@v4 diff --git a/.golangci.yml b/.golangci.yml index 59e9d86..c587027 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,16 +1,13 @@ linters: disable-all: true # 关闭其他linter enable: # 下面是开启的linter列表,之后的英文注释介绍了相应linter的功能 - - deadcode # Finds unused code - errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases - gosimple # Linter for Go source code that specializes in simplifying a code - govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string - ineffassign # Detects when assignments to existing variables are not used - staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks - - structcheck # Finds unused struct fields - typecheck # Like the front-end of a Go compiler, parses and type-checks Go code - unused # Checks Go code for unused constants, variables, functions and types - - varcheck # Finds unused global variables and constants - exportloopref # checks for pointers to enclosing loop variables # - golint # Carry out the stylistic conventions put forth in Effective Go and CodeReviewComments @@ -19,3 +16,8 @@ linters-settings: enable-all: true disable: - fieldalignment +issues: + exclude-dirs: + - scripts + - test + - example