Skip to content

Commit e3eb51b

Browse files
authored
Merge pull request #269 from spillway/master
exclude crypto/rand.Read by default
2 parents 11c27a7 + 9f73cd5 commit e3eb51b

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)