Skip to content

Commit

Permalink
update .golangci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
vearne committed Oct 11, 2024
1 parent 756e3a9 commit a455212
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golang-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -19,3 +16,8 @@ linters-settings:
enable-all: true
disable:
- fieldalignment
issues:
exclude-dirs:
- scripts
- test
- example

0 comments on commit a455212

Please sign in to comment.