-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
35 lines (29 loc) · 1.66 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
27
28
29
30
31
32
33
34
35
linters-settings:
golint:
min-confidence: 0.8 # Sets the confidence level for golint to report issues (0.8 is the default).
errcheck:
ignore: # List of error checks to ignore.
- fmt.Fprintf # Example: Ignores unchecked errors for fmt.Fprintf.
linters:
enable:
- govet # Enables the govet linter, which checks for potential bugs.
- golint # Enables golint, which checks for style issues.
- errcheck # Enables errcheck, which checks for unchecked errors.
- staticcheck # Enables staticcheck, which performs various advanced static analysis checks.
- gosimple # Suggests simplifications to your Go code.
- goconst # Detects repeated strings that could be constants.
disable:
- gocyclo # Disables gocyclo, which checks for high cyclomatic complexity (complex code paths).
run:
timeout: 2m # Sets a timeout for the linter run. If the linting process takes longer, it will be terminated.
issues-exit-code: 1 # Sets the exit code if any issues are found. Useful for CI/CD integration.
issues:
exclude-rules:
exclude-use-default: false # Disables default exclusion rules (if true, default exclusions won't apply).
output:
format: colored-line-number # Sets the output format (other options: line-number, JSON, tab, etc.).
color: true # Enables colored output in the terminal.
checks:
# Define or enable specific checks within linters that support it.
unusedparams: true # Enable the check for unused parameters in functions.
shadow: true # Enable the check for shadowed variables.