Skip to content

Commit 9f73cd5

Browse files
committed
exclude crypto/rand.Read by default
1 parent 11c27a7 commit 9f73cd5

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

errcheck/excludes.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ var DefaultExcludedSymbols = []string{
1717
"(*bytes.Buffer).WriteRune",
1818
"(*bytes.Buffer).WriteString",
1919

20+
// crypto
21+
"crypto/rand.Read", // https://github.com/golang/go/issues/66821
22+
2023
// fmt
2124
"fmt.Print",
2225
"fmt.Printf",

testdata/crypto_rand.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package main
2+
3+
import (
4+
"crypto/rand"
5+
)
6+
7+
func ignoreRandReaderReturns() {
8+
buf := make([]byte, 128)
9+
rand.Read(buf) // EXCLUDED
10+
}

0 commit comments

Comments
 (0)