mirror of
https://github.com/grafana/grafana.git
synced 2024-11-23 09:26:43 -06:00
pkg/tsdb/stackdriver/stackdriver.go: Fix regular expression does not contain any meta characters.
See,
$ gometalinter --vendor --deadline 10m --disable-all --enable=megacheck ./...
pkg/tsdb/stackdriver/stackdriver.go:171:26⚠️ regular expression does not contain any meta characters (SA6004) (megacheck)
This commit is contained in:
parent
bb12a1bc99
commit
91447dcbf9
@ -168,8 +168,7 @@ func reverse(s string) string {
|
||||
}
|
||||
|
||||
func interpolateFilterWildcards(value string) string {
|
||||
re := regexp.MustCompile("[*]")
|
||||
matches := len(re.FindAllStringIndex(value, -1))
|
||||
matches := strings.Count(value, "*")
|
||||
if matches == 2 && strings.HasSuffix(value, "*") && strings.HasPrefix(value, "*") {
|
||||
value = strings.Replace(value, "*", "", -1)
|
||||
value = fmt.Sprintf(`has_substring("%s")`, value)
|
||||
|
Loading…
Reference in New Issue
Block a user