Skip to content

Commit 7c872f6

Browse files
committed
Update golangci lint
Signed-off-by: Derek McGowan <derek@mcg.dev>
1 parent 50e5387 commit 7c872f6

File tree

3 files changed

+21
-29
lines changed

3 files changed

+21
-29
lines changed

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,9 @@ jobs:
3838
cache: false # see actions/setup-go#368
3939

4040
- uses: actions/checkout@v4
41-
- uses: golangci/golangci-lint-action@v6
41+
- uses: golangci/golangci-lint-action@v7
4242
with:
43-
version: v1.61.0
44-
skip-cache: true
45-
args: --timeout=5m
43+
version: v2.1.5
4644

4745
#
4846
# Project checks

‎.golangci.yml‎

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,25 @@
1+
version: "2"
12
linters:
23
enable:
34
- copyloopvar
4-
- gofmt
5-
- goimports
5+
- dupword
66
- gosec
7-
- ineffassign
87
- misspell
98
- nolintlint
109
- revive
11-
- staticcheck
12-
- tenv # Detects using os.Setenv instead of t.Setenv since Go 1.17
1310
- unconvert
14-
- unused
15-
- govet
16-
- dupword # Checks for duplicate words in the source code
1711
disable:
1812
- errcheck
19-
20-
run:
21-
timeout: 5m
22-
23-
issues:
24-
exclude-dirs:
25-
- api
26-
- cluster
27-
- design
28-
- docs
29-
- docs/man
30-
- releases
31-
- reports
32-
- test # e2e scripts
13+
exclusions:
14+
generated: lax
15+
presets:
16+
- comments
17+
- common-false-positives
18+
- legacy
19+
- std-error-handling
20+
formatters:
21+
enable:
22+
- gofmt
23+
- goimports
24+
exclusions:
25+
generated: lax

‎cpuinfo_other.go‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ func getCPUVariant() (string, error) {
2727

2828
var variant string
2929

30-
if runtime.GOOS == "windows" || runtime.GOOS == "darwin" {
30+
switch runtime.GOOS {
31+
case "windows", "darwin":
3132
// Windows/Darwin only supports v7 for ARM32 and v8 for ARM64 and so we can use
3233
// runtime.GOARCH to determine the variants
3334
switch runtime.GOARCH {
@@ -38,7 +39,7 @@ func getCPUVariant() (string, error) {
3839
default:
3940
variant = "unknown"
4041
}
41-
} else if runtime.GOOS == "freebsd" {
42+
case "freebsd":
4243
// FreeBSD supports ARMv6 and ARMv7 as well as ARMv4 and ARMv5 (though deprecated)
4344
// detecting those variants is currently unimplemented
4445
switch runtime.GOARCH {
@@ -47,7 +48,7 @@ func getCPUVariant() (string, error) {
4748
default:
4849
variant = "unknown"
4950
}
50-
} else {
51+
default:
5152
return "", fmt.Errorf("getCPUVariant for OS %s: %v", runtime.GOOS, errNotImplemented)
5253
}
5354

0 commit comments

Comments
 (0)