Skip to content

Commit

Permalink
ST1003: add exception for fuzz functions
Browse files Browse the repository at this point in the history
Closes: gh-1420
(cherry picked from commit ddee6bb)
  • Loading branch information
dominikh committed Aug 17, 2023
1 parent 3d5eab6 commit cdf983c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion stylecheck/names.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ func CheckNames(pass *analysis.Pass) (interface{}, error) {
return
}

if code.IsInTest(pass, v) && (strings.HasPrefix(v.Name.Name, "Example") || strings.HasPrefix(v.Name.Name, "Test") || strings.HasPrefix(v.Name.Name, "Benchmark")) {
if code.IsInTest(pass, v) &&
(strings.HasPrefix(v.Name.Name, "Example") ||
strings.HasPrefix(v.Name.Name, "Test") ||
strings.HasPrefix(v.Name.Name, "Benchmark") ||
strings.HasPrefix(v.Name.Name, "Fuzz")) {
return
}

Expand Down

0 comments on commit cdf983c

Please sign in to comment.