Merge pull request #13679 from mjtrangoni/fix-megacheck-issues

Fix megacheck issues
This commit is contained in:
Torkel Ödegaard
2018-10-25 16:31:53 +02:00
committed by GitHub
7 changed files with 24 additions and 28 deletions

View File

@@ -186,8 +186,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)