Skip to content

Commit f3dc0ee

Browse files
committed
Forbidigo: prevent os fs operations
Signed-off-by: apostasie <[email protected]>
1 parent 21e1124 commit f3dc0ee

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.golangci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ linters:
3131
- revive
3232
# Gocritic
3333
- gocritic
34+
- forbidigo
3435

3536
# 3. We used to use these, but have now removed them
3637

@@ -41,6 +42,12 @@ linters:
4142
# - nakedret
4243

4344
settings:
45+
forbidigo:
46+
forbid:
47+
# FIXME: there are still calls to os.WriteFile in tests under `cmd`
48+
- pattern: ^os\.WriteFile.*$
49+
pkg: github.com/containerd/nerdctl/v2/pkg
50+
msg: os.WriteFile is neither atomic nor durable - use nerdctl filesystem.WriteFile instead
4451
staticcheck:
4552
checks:
4653
# Below is the default set

0 commit comments

Comments
 (0)