Skip to content

Commit 1a22a35

Browse files
committed
lint: enable exhaustive, gocritic, nilerr
In this commit, we enable extra linters to check for non-exhaustive switch statements, and if-else or switch statements that can be simplified. We also check for improper error returns and other small simplifications.
1 parent 10f0e3a commit 1a22a35

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.golangci.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,15 @@ linters-settings:
2323
excludes:
2424
- G402 # Look for bad TLS connection settings.
2525
- G306 # Poor file permissions used when writing to a new file.
26+
exhaustive:
27+
default-signifies-exhaustive: true
28+
gocritic:
29+
enabled-checks:
30+
- singleCaseSwitch
31+
- ifElseChain
32+
- assignOp
33+
- unlambda
2634
staticcheck:
27-
go: "1.19"
2835
checks: ["-SA1019"]
2936

3037
linters:
@@ -34,6 +41,11 @@ linters:
3441
- tagliatelle
3542
- whitespace
3643
- gosec
44+
- unused
45+
- gocritic
46+
- unconvert
47+
- nilerr
48+
- exhaustive
3749

3850
issues:
3951
exclude-rules:

0 commit comments

Comments
 (0)