From cb3b9f8b66f38ff1aa0763d031b9b1d9108942f7 Mon Sep 17 00:00:00 2001 From: Karsten Weiss Date: Mon, 16 Apr 2018 20:19:19 +0200 Subject: [PATCH] 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) --- pkg/services/alerting/rule.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/services/alerting/rule.go b/pkg/services/alerting/rule.go index bdf53798e34..027ff96d6c0 100644 --- a/pkg/services/alerting/rule.go +++ b/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{