Skip to content

Commit ed89602

Browse files
prattmicgvisor-bot
authored andcommitted
Disable SA1019 (deprecation check)
On Go tip (pre-1.18), http://golang.org/issue/44195 is making SA1019 mistake uses of reflect.Value.Len for reflect.Value.InterfaceData, which is deprecated. It is thus mistakenly raising deprecation errors on uses of reflect.Value.Len. Suppress these errors by disabling SA1019 entirely. This is a bit overkill, but it is unclear to me if we want hard errors on deprecation anyways. That can be reevaluated when http://golang.org/issue/44195 is fixed. The other staticcheck analyzers are moved to alphabetical order. Updates golang/go#44195 PiperOrigin-RevId: 390655918
1 parent 8f2b11a commit ed89602

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

nogo.yaml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -161,29 +161,35 @@ analyzers:
161161
# targets in the standard library, so we still need to run
162162
# checklinkname on stdlib generally.
163163
- "linkname to unknown symbol"
164-
SA4016:
164+
SA1019: # Use of deprecated identifier.
165+
# disable for now due to misattribution from golang.org/issue/44195.
166+
generated:
167+
exclude: [".*"]
165168
internal:
166-
exclude:
167-
- pkg/gohacks/gohacks_unsafe.go # x ^ 0 always equals x.
168-
SA2001:
169+
exclude: [".*"]
170+
SA2001: # Empty critical section.
169171
internal:
170172
exclude:
171173
- pkg/sentry/fs/fs.go # Intentional.
172174
- pkg/sentry/fs/gofer/inode.go # Intentional.
173175
- pkg/refs/refcounter_test.go # Intentional.
174-
ST1019:
176+
SA4016: # Useless bitwise operations.
177+
internal:
178+
exclude:
179+
- pkg/gohacks/gohacks_unsafe.go # x ^ 0 always equals x.
180+
SA5011: # Possible nil pointer dereference.
181+
internal:
182+
exclude:
183+
# https://github.com/dominikh/go-tools/issues/924
184+
- pkg/sentry/fs/fdpipe/pipe_opener_test.go
185+
- pkg/tcpip/tests/integration/link_resolution_test.go
186+
ST1019: # Multiple imports of the same package.
175187
generated:
176188
exclude:
177189
# package ".../kubeapi/core/v1/v1" is being imported more than once
178190
- generated.gen.pb.go
179-
ST1021:
191+
ST1021: # Doc should start with type name.
180192
internal:
181193
suppress:
182194
- "comment on exported type Translation" # Intentional.
183195
- "comment on exported type PinnedRange" # Intentional.
184-
SA5011:
185-
internal:
186-
exclude:
187-
# https://github.com/dominikh/go-tools/issues/924
188-
- pkg/sentry/fs/fdpipe/pipe_opener_test.go
189-
- pkg/tcpip/tests/integration/link_resolution_test.go

0 commit comments

Comments
 (0)