Skip to content

Commit 185b1e3

Browse files
committed
Add lint rule to forbid old-style atomic ops
Signed-off-by: Cory Snider <[email protected]>
1 parent 5e64a7a commit 185b1e3

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.golangci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ linters:
66
- gosec
77
- gosimple
88
- govet
9+
- forbidigo
910
- importas
1011
- ineffassign
1112
- misspell
@@ -31,6 +32,12 @@ linters-settings:
3132
- "true" # some tests use this as expected output
3233
- "false" # some tests use this as expected output
3334
- "root" # for tests using "ls" output with files owned by "root:root"
35+
forbidigo:
36+
forbid:
37+
- pkg: ^sync/atomic$
38+
p: ^atomic\.(Add|CompareAndSwap|Load|Store|Swap).
39+
msg: Go 1.19 atomic types should be used instead.
40+
analyze-types: true
3441
importas:
3542
# Do not allow unaliased imports of aliased packages.
3643
no-unaliased: true

0 commit comments

Comments
 (0)