Skip to content

Commit 90900b0

Browse files
committed
golangci-lint: enable more linters
Enables the asasalint, exptostd, fatcontext, gocheckcompilerdirectives, iface, makezero, and spancheck linters. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 01a43f1 commit 90900b0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.golangci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ formatters:
2626

2727
linters:
2828
enable:
29+
- asasalint # Detects "[]any" used as argument for variadic "func(...any)".
2930
- bodyclose
3031
- copyloopvar # Detects places where loop variables are copied.
3132
- depguard
@@ -35,11 +36,15 @@ linters:
3536
- errcheck
3637
- errchkjson # Detects unsupported types passed to json encoding functions and reports if checks for the returned error can be omitted.
3738
- exhaustive # Detects missing options in enum switch statements.
39+
- exptostd # Detects functions from golang.org/x/exp/ that can be replaced by std functions.
40+
- fatcontext # Detects nested contexts in loops and function literals.
3841
- forbidigo
42+
- gocheckcompilerdirectives # Detects invalid go compiler directive comments (//go:).
3943
- gocritic # Metalinter; detects bugs, performance, and styling issues.
4044
- gocyclo
4145
- gosec # Detects security problems.
4246
- govet
47+
- iface # Detects incorrect use of interfaces. Currently only used for "identical" interfaces in the same package.
4348
- importas # Enforces consistent import aliases.
4449
- ineffassign
4550
- makezero # Finds slice declarations with non-zero initial length.
@@ -54,6 +59,7 @@ linters:
5459
- predeclared # Detects code that shadows one of Go's predeclared identifiers
5560
- reassign # Detects reassigning a top-level variable in another package.
5661
- revive # Metalinter; drop-in replacement for golint.
62+
- spancheck # Detects mistakes with OpenTelemetry/Census spans.
5763
- staticcheck
5864
- thelper # Detects test helpers without t.Helper().
5965
- tparallel # Detects inappropriate usage of t.Parallel().

0 commit comments

Comments
 (0)