Skip to content

Commit 0dd2c18

Browse files
committed
golangci-lint: update to v1.49.0 for compatibilty with go1.19
Remove the "deadcode", "structcheck", and "varcheck" linters, as they are deprecated: WARN [runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. WARN [runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. WARN [runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. WARN [linters context] structcheck is disabled because of generics. You can track the evolution of the generics support by following the golangci/golangci-lint#2649. And ignore gosec G113, which only affects gp < 1.16.14. and go < 1.17.7 opts/opts.go:398:13: G113: Potential uncontrolled memory consumption in Rat.SetString (CVE-2022-23772) (gosec) cpu, ok := new(big.Rat).SetString(value) ^ Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 3dfdaa6 commit 0dd2c18

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.golangci.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
linters:
22
enable:
33
- bodyclose
4-
- deadcode
54
- depguard
65
- dogsled
76
- gocyclo
@@ -14,14 +13,12 @@ linters:
1413
- megacheck
1514
- misspell
1615
- nakedret
16+
- revive
1717
- staticcheck
18-
- structcheck
1918
- typecheck
2019
- unconvert
2120
- unparam
2221
- unused
23-
- revive
24-
- varcheck
2522

2623
disable:
2724
- errcheck
@@ -98,6 +95,12 @@ issues:
9895
linters:
9996
- gosec
10097

98+
# G113 Potential uncontrolled memory consumption in Rat.SetString (CVE-2022-23772)
99+
# only affects gp < 1.16.14. and go < 1.17.7
100+
- text: "(G113)"
101+
linters:
102+
- gosec
103+
101104
# Looks like the match in "EXC0007" above doesn't catch this one
102105
# TODO: consider upstreaming this to golangci-lint's default exclusion rules
103106
- text: "G204: Subprocess launched with a potential tainted input or cmd arguments"
@@ -109,6 +112,11 @@ issues:
109112
linters:
110113
- gosec
111114

115+
# TODO: make sure all packages have a description. Currently, there's 67 packages without.
116+
- text: "package-comments: should have a package comment"
117+
linters:
118+
- revive
119+
112120
# Exclude some linters from running on tests files.
113121
- path: _test\.go
114122
linters:

dockerfiles/Dockerfile.lint

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# syntax=docker/dockerfile:1
22

33
ARG GO_VERSION=1.18.5
4-
ARG GOLANGCI_LINT_VERSION=v1.45.2
4+
ARG GOLANGCI_LINT_VERSION=v1.49.0
55

66
FROM golangci/golangci-lint:${GOLANGCI_LINT_VERSION}-alpine AS golangci-lint
77

0 commit comments

Comments
 (0)