Skip to content

Commit

Permalink
regexp: use switch for fn check
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonboom committed Jun 21, 2024
1 parent 9948083 commit da583ad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/checkers/regexp.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ func NewRegexp() Regexp { return Regexp{} }
func (Regexp) Name() string { return "regexp" }

func (checker Regexp) Check(pass *analysis.Pass, call *CallMeta) *analysis.Diagnostic {
if n := call.Fn.NameFTrimmed; n != "Regexp" && n != "NotRegexp" {
switch call.Fn.NameFTrimmed {
default:
return nil
case "Regexp", "NotRegexp":
}

if len(call.Args) < 1 {
Expand Down

0 comments on commit da583ad

Please sign in to comment.