From: Alekseev Artem Date: Sat, 7 Apr 2018 14:10:45 +0000 (+0300) Subject: cmd/internal/obj/x86: use raw string literals in regexp X-Git-Tag: go1.11beta1~928 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d8b417e00b3f19f7fb47aaa64fe107ed59f6603f;p=gostls13.git cmd/internal/obj/x86: use raw string literals in regexp Found with megacheck (S1007). Change-Id: Icb15fd5bfefa8e0b39a1bfa9ec3e9af3eff6b390 Reviewed-on: https://go-review.googlesource.com/105415 Run-TryBot: Iskander Sharipov Reviewed-by: Daniel Martí TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/internal/obj/x86/obj6_test.go b/src/cmd/internal/obj/x86/obj6_test.go index e311c62e08..2f6296ce8b 100644 --- a/src/cmd/internal/obj/x86/obj6_test.go +++ b/src/cmd/internal/obj/x86/obj6_test.go @@ -74,7 +74,7 @@ func parseTestData(t *testing.T) *ParsedTestData { return r } -var spaces_re *regexp.Regexp = regexp.MustCompile("\\s+") +var spaces_re *regexp.Regexp = regexp.MustCompile(`\s+`) func normalize(s string) string { return spaces_re.ReplaceAllLiteralString(strings.TrimSpace(s), " ") @@ -115,7 +115,7 @@ func asmOutput(t *testing.T, s string) []byte { func parseOutput(t *testing.T, td *ParsedTestData, asmout []byte) { scanner := bufio.NewScanner(bytes.NewReader(asmout)) - marker := regexp.MustCompile("MOVQ \\$([0-9]+), AX") + marker := regexp.MustCompile(`MOVQ \$([0-9]+), AX`) mark := -1 td.marker_to_output = make(map[int][]string) for scanner.Scan() {