Skip to content

Commit 48151d4

Browse files
thaJeztahcorhere
authored andcommitted
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]> (cherry picked from commit 0dd2c18) Signed-off-by: Cory Snider <[email protected]>
1 parent 2d955cb commit 48151d4

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.golangci.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
linters:
22
enable:
33
- bodyclose
4-
- deadcode
54
- dogsled
65
- gocyclo
76
- goimports
@@ -13,14 +12,12 @@ linters:
1312
- megacheck
1413
- misspell
1514
- nakedret
15+
- revive
1616
- staticcheck
17-
- structcheck
1817
- typecheck
1918
- unconvert
2019
- unparam
2120
- unused
22-
- revive
23-
- varcheck
2421

2522
disable:
2623
- errcheck
@@ -93,6 +90,12 @@ issues:
9390
linters:
9491
- gosec
9592

93+
# G113 Potential uncontrolled memory consumption in Rat.SetString (CVE-2022-23772)
94+
# only affects gp < 1.16.14. and go < 1.17.7
95+
- text: "(G113)"
96+
linters:
97+
- gosec
98+
9699
# Looks like the match in "EXC0007" above doesn't catch this one
97100
# TODO: consider upstreaming this to golangci-lint's default exclusion rules
98101
- text: "G204: Subprocess launched with a potential tainted input or cmd arguments"
@@ -104,6 +107,11 @@ issues:
104107
linters:
105108
- gosec
106109

110+
# TODO: make sure all packages have a description. Currently, there's 67 packages without.
111+
- text: "package-comments: should have a package comment"
112+
linters:
113+
- revive
114+
107115
# Exclude some linters from running on tests files.
108116
- path: _test\.go
109117
linters:

dockerfiles/Dockerfile.lint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
ARG GO_VERSION=1.18.10
44
ARG ALPINE_VERSION=3.16
5-
ARG GOLANGCI_LINT_VERSION=v1.45.2
5+
ARG GOLANGCI_LINT_VERSION=v1.49.0
66

77
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS build
88
ENV CGO_ENABLED=0

0 commit comments

Comments
 (0)