Chore/fix lint issues (#27704)
* Chore: Fix linting issues Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
@@ -320,7 +320,7 @@ func interpolateFilterWildcards(value string) string {
|
||||
matches := strings.Count(value, "*")
|
||||
switch {
|
||||
case matches == 2 && strings.HasSuffix(value, "*") && strings.HasPrefix(value, "*"):
|
||||
value = strings.Replace(value, "*", "", -1)
|
||||
value = strings.ReplaceAll(value, "*", "")
|
||||
value = fmt.Sprintf(`has_substring("%s")`, value)
|
||||
case matches == 1 && strings.HasPrefix(value, "*"):
|
||||
value = strings.Replace(value, "*", "", 1)
|
||||
@@ -332,8 +332,8 @@ func interpolateFilterWildcards(value string) string {
|
||||
value = string(wildcardRegexRe.ReplaceAllFunc([]byte(value), func(in []byte) []byte {
|
||||
return []byte(strings.Replace(string(in), string(in), `\\`+string(in), 1))
|
||||
}))
|
||||
value = strings.Replace(value, "*", ".*", -1)
|
||||
value = strings.Replace(value, `"`, `\\"`, -1)
|
||||
value = strings.ReplaceAll(value, "*", ".*")
|
||||
value = strings.ReplaceAll(value, `"`, `\\"`)
|
||||
value = fmt.Sprintf(`monitoring.regex.full_match("^%s$")`, value)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user