Skip to content

Commit d789981

Browse files
committed
Fix gosec false positives in golangci-lint
Exclude G115 (int-to-byte narrowing after bit shifts in tests) and G602 (slice index on fixed-size arrays with known bounds).
1 parent d78c1fa commit d789981

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.golangci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ linters:
3232
- linters: [gosec]
3333
rules: [G505]
3434
path: generate\.go
35+
# Narrowing int64/uint64 to byte after shifting is intentional in bit packing.
36+
- linters: [gosec]
37+
rules: [G115]
38+
path: _test\.go
39+
# Loop bounds are guaranteed by fixed-size arrays (hexOffsets [16]int, UUID [16]byte).
40+
- linters: [gosec]
41+
rules: [G602]
42+
path: \.go
3543

3644
settings:
3745
godot:

0 commit comments

Comments
 (0)