stackdriver: test that no interpolation is done when there are no wildcards

(cherry picked from commit 5f7795aa1f)
This commit is contained in:
Erik Sundell
2018-10-02 17:58:31 +02:00
committed by bergquist
parent 84094b5051
commit 93fb427310
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -179,7 +179,7 @@ func interpolateFilterWildcards(value string) string {
} else if matches == 1 && strings.HasSuffix(value, "*") {
value = reverse(strings.Replace(reverse(value), "*", "", 1))
value = fmt.Sprintf(`starts_with("%s")`, value)
} else if matches == 1 {
} else if matches != 0 {
re := regexp.MustCompile(`[-\/^$+?.()|[\]{}]`)
value = string(re.ReplaceAllFunc([]byte(value), func(in []byte) []byte {
return []byte(strings.Replace(string(in), string(in), `\\`+string(in), 1))