From 8964fc2180124248e0e086e22cead744c35aa13c Mon Sep 17 00:00:00 2001 From: guangwu Date: Sat, 11 Nov 2023 06:16:47 +0800 Subject: [PATCH] chore: use raw string () with regexp.MustCompile to avoid having to escape twice (#6396) --- plugin/template/cname_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/template/cname_test.go b/plugin/template/cname_test.go index 6ce6d7d2d..eef949e2d 100644 --- a/plugin/template/cname_test.go +++ b/plugin/template/cname_test.go @@ -31,7 +31,7 @@ func TestTruncatedCNAME(t *testing.T) { handler := Handler{ Zones: []string{"."}, Templates: []template{{ - regex: []*regexp.Regexp{regexp.MustCompile("^cname\\.test\\.$")}, + regex: []*regexp.Regexp{regexp.MustCompile(`^cname\.test\.$`)}, answer: []*gotmpl.Template{gotmpl.Must(gotmpl.New("answer").Parse(up.Answer[0].String()))}, qclass: dns.ClassINET, qtype: dns.TypeA,