staticcheck/sa6000/testdata/go1.0/CheckRegexpMatchLoop/CheckRegexpMatchLoop.go
raw| 1 | package pkg |
| 2 | |
| 3 | import "regexp" |
| 4 | |
| 5 | func fn() { |
| 6 | regexp.Match(".", nil) |
| 7 | regexp.MatchString(".", "") |
| 8 | regexp.MatchReader(".", nil) |
| 9 | |
| 10 | for { |
| 11 | regexp.Match(".", nil) //@ diag(`calling regexp.Match in a loop has poor performance`) |
| 12 | regexp.MatchString(".", "") //@ diag(`calling regexp.MatchString in a loop has poor performance`) |
| 13 | regexp.MatchReader(".", nil) //@ diag(`calling regexp.MatchReader in a loop has poor performance`) |
| 14 | } |
| 15 | } |