You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* bump boilerplate to v7.0.0
* bump go version to 1.23
* Update golangci-lint to v2, migrate config, fix lint issues
* Explicitly set GOROOT on lint, see golangci-lint/issues/3107
golangci/golangci-lint#3107
* lint error string
# print linter name in the end of issue text, default is true
22
-
print-linter-name: true
23
-
24
-
# make issues output unique by line, default is true
25
-
uniq-by-line: true
26
-
27
-
# add a prefix to the output file references; default is no prefix
28
5
path-prefix: ""
29
-
30
-
# sorts results by: filepath, line and column
31
-
sort-results: false
32
-
33
-
# default linters are enabled `golangci-lint help linters`
34
6
linters:
35
-
disable-all: true
7
+
default: none
36
8
enable:
37
-
## enabled by default
38
-
- errcheck # checking for unchecked errors, these unchecked errors can be critical bugs in some cases
39
-
- gosimple # specializes in simplifying a code
40
-
- govet # reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
41
-
- ineffassign # detects when assignments to existing variables are not used
42
-
- staticcheck # is a go vet on steroids, applying a ton of static analysis checks
43
-
- typecheck # like the front-end of a Go compiler, parses and type-checks Go code
44
-
- unused # checks for unused constants, variables, functions and types
45
-
46
-
## disabled by default
47
-
- asasalint # Check for pass []any as any in variadic func(...any)
48
-
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers
49
-
- bidichk # Checks for dangerous unicode character sequences
50
-
- bodyclose # Checks whether HTTP response body is closed successfully
51
-
- decorder # Check declaration order and count of types, constants, variables and functions
52
-
- dupword # Checks for duplicate words in the source code
53
-
- durationcheck # Check for two durations multiplied together
54
-
- errchkjson # Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occasions, where the check for the returned error can be omitted.
55
-
- errname # Checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error.
56
-
- errorlint # Errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13.
57
-
- exportloopref # Checks for pointers to enclosing loop variables
58
-
- ginkgolinter # Enforces standards of using ginkgo and gomega
59
-
- gocheckcompilerdirectives # Checks that go compiler directive comments (//go:) are valid.
60
-
- goconst # Finds repeated strings that could be replaced by a constant
61
-
- gocritic # Provides diagnostics that check for bugs, performance and style issues.
62
-
- gocyclo # Computes and checks the cyclomatic complexity of functions
63
-
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
64
-
- gofumpt # Gofumpt checks whether code was gofumpt-ed.
65
-
- goheader # Checks is file header matches to pattern
66
-
- goimports # Check import statements are formatted according to the 'goimport' command. Reformat imports in autofix mode.
67
-
- gomodguard # Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations.
68
-
- gosec # Inspects source code for security problems
69
-
- grouper # An analyzer to analyze expression groups.
70
-
- importas # Enforces consistent import aliases
71
-
- loggercheck # Checks key value pairs for common logger libraries (kitlog,klog,logr,zap).
72
-
- maintidx # Maintidx measures the maintainability index of each function.
73
-
- makezero # Finds slice declarations with non-zero initial length
74
-
- misspell # Finds commonly misspelled English words in comments
75
-
- nestif # Reports deeply nested if statements
76
-
- nilerr # Finds the code that returns nil even if it checks that the error is not nil.
77
-
- nilnil # Checks that there is no simultaneous return of nil error and an invalid value.
78
-
- noctx # Noctx finds sending http request without context.Context
79
-
- nolintlint # Reports ill-formed or insufficient nolint directives
80
-
- nosprintfhostport # Checks for misuse of Sprintf to construct a host with port in a URL.
81
-
- prealloc # Finds slice declarations that could potentially be pre-allocated
82
-
- predeclared # Find code that shadows one of Go's predeclared identifiers
83
-
- promlinter # Check Prometheus metrics naming via promlint
84
-
- reassign # Checks that package variables are not reassigned
85
-
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint.
86
-
- rowserrcheck # Checks whether Err of rows is checked successfully
87
-
- tenv # Tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17
88
-
- thelper # Thelper detects Go test helpers without t.Helper() call and checks the consistency of test helpers
89
-
- tparallel # Tparallel detects inappropriate usage of t.Parallel() method in your Go test codes
90
-
- unconvert # Remove unnecessary type conversions
91
-
- usestdlibvars # A linter that detect the possibility to use variables/constants from the Go standard library.
0 commit comments