This product is not supported for your selected Datadog site. ().
Cette page n'est pas encore disponible en français, sa traduction est en cours. Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.
Metadata
ID:go-best-practices/regexp-zero-results
Language: Go
Severity: Info
Category: Best Practices
Description
Go, invoking the function re.FindAll() with the second argument set to 0 will not return any results.
funcmain(){res1:=regexp.MustCompile("foo(").FindAll(nil,1)varr2regexp.Regexpres:=r2.FindAll(something,1)// FindAll called on a non-Regexp object
varmyObjMyClassres2:=myObj.FindAll(something,0)}
1
2
rulesets:- go-best-practices # Rules to enforce Go best practices.