github.com/golangci/go-tools@v0.0.0-20190318060251-af6baa5dc196/staticcheck/testdata/src/CheckRegexpMatchLoop/CheckRegexpMatchLoop.go (about)

     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)       // MATCH /calling regexp.Match in a loop has poor performance/
    12  		regexp.MatchString(".", "")  // MATCH /calling regexp.MatchString in a loop has poor performance/
    13  		regexp.MatchReader(".", nil) // MATCH /calling regexp.MatchReader in a loop has poor performance/
    14  	}
    15  }