-
Notifications
You must be signed in to change notification settings - Fork 3
/
.golangci.yml
26 lines (24 loc) · 1.37 KB
/
.golangci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
linters:
disable-all: true
enable:
- 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
# 比较常用的可选项
- gofmt # Gofmt checks whether code was gofmt-ed.
- misspell
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go
# - golint # Carry out the stylistic conventions put forth in Effective Go and CodeReviewComments
linters-settings:
govet:
check-shadowing: true
check-unreachable: true
check-rangeloops: true
check-copylocks: true