Skip to content

Commit cdf983c

Browse files
committed
ST1003: add exception for fuzz functions
Closes: gh-1420 (cherry picked from commit ddee6bb)
1 parent 3d5eab6 commit cdf983c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

stylecheck/names.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ func CheckNames(pass *analysis.Pass) (interface{}, error) {
114114
return
115115
}
116116

117-
if code.IsInTest(pass, v) && (strings.HasPrefix(v.Name.Name, "Example") || strings.HasPrefix(v.Name.Name, "Test") || strings.HasPrefix(v.Name.Name, "Benchmark")) {
117+
if code.IsInTest(pass, v) &&
118+
(strings.HasPrefix(v.Name.Name, "Example") ||
119+
strings.HasPrefix(v.Name.Name, "Test") ||
120+
strings.HasPrefix(v.Name.Name, "Benchmark") ||
121+
strings.HasPrefix(v.Name.Name, "Fuzz")) {
118122
return
119123
}
120124

0 commit comments

Comments
 (0)