Skip to content

Commit 83deb0e

Browse files
committed
exclude maphash methods that "never fail"
1 parent b832de3 commit 83deb0e

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

errcheck/excludes.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ var DefaultExcludedSymbols = []string{
4747

4848
// hash
4949
"(hash.Hash).Write",
50+
51+
// hash/maphash
52+
"(*hash/maphash.Hash).Write",
53+
"(*hash/maphash.Hash).WriteByte",
54+
"(*hash/maphash.Hash).WriteString",
5055
}
5156

5257
// ReadExcludes reads an excludes file, a newline delimited file that lists

testdata/hash.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package main
2+
3+
import "hash/maphash"
4+
5+
6+
func ignoreHashMapReturns() {
7+
var hasher maphash.Hash
8+
hasher.Write(nil) // EXCLUDED
9+
hasher.WriteByte(0) // EXCLUDED
10+
hasher.WriteString("") // EXCLUDED
11+
}

0 commit comments

Comments
 (0)