Explorar o código

Use raw strings to avoid double escapes (gosimple)

This fixes:
pkg/services/alerting/rule.go:58:21: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007\)
pkg/services/alerting/rule.go:59:21: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007)
Karsten Weiss %!s(int64=7) %!d(string=hai) anos
pai
achega
cb3b9f8b66
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      pkg/services/alerting/rule.go

+ 2 - 2
pkg/services/alerting/rule.go

@@ -55,8 +55,8 @@ func (e ValidationError) Error() string {
 }
 
 var (
-	ValueFormatRegex = regexp.MustCompile("^\\d+")
-	UnitFormatRegex  = regexp.MustCompile("\\w{1}$")
+	ValueFormatRegex = regexp.MustCompile(`^\d+`)
+	UnitFormatRegex  = regexp.MustCompile(`\w{1}$`)
 )
 
 var unitMultiplier = map[string]int{