Skip to content

regexp-find-all-zero

Detect regexp FindAll calls with a zero result limit.

Updated View as Markdown

Default severity: warning

A zero limit always returns no matches. Use a negative limit for all matches.

Bad

matches := expression.FindAllString(input, 0)

Good

matches := expression.FindAllString(input, -1)
Navigation

Type to search…

↑↓ navigate↵ selectEsc close