From: guoguangwu Date: Mon, 11 Mar 2024 01:22:21 +0000 (+0000) Subject: cmd/compile: use raw strings to avoid double escapes X-Git-Tag: go1.23rc1~929 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=78755f6b8c5f18b0014e9dcac383898047ff14fe;p=gostls13.git cmd/compile: use raw strings to avoid double escapes Change-Id: I39917b90b67f630f8212853c0a201635960275cb GitHub-Last-Rev: fe886534b493fc6241b4451256c889b2fdee997f GitHub-Pull-Request: golang/go#66180 Reviewed-on: https://go-review.googlesource.com/c/go/+/569975 Auto-Submit: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI Reviewed-by: Ian Lance Taylor Reviewed-by: Keith Randall Reviewed-by: Keith Randall --- diff --git a/src/cmd/compile/internal/ssa/debug_test.go b/src/cmd/compile/internal/ssa/debug_test.go index 9ac414c824..2effed855c 100644 --- a/src/cmd/compile/internal/ssa/debug_test.go +++ b/src/cmd/compile/internal/ssa/debug_test.go @@ -32,11 +32,11 @@ var ( var ( hexRe = regexp.MustCompile("0x[a-zA-Z0-9]+") - numRe = regexp.MustCompile("-?\\d+") - stringRe = regexp.MustCompile("\"([^\\\"]|(\\.))*\"") - leadingDollarNumberRe = regexp.MustCompile("^[$]\\d+") + numRe = regexp.MustCompile(`-?\d+`) + stringRe = regexp.MustCompile(`([^\"]|(\.))*`) + leadingDollarNumberRe = regexp.MustCompile(`^[$]\d+`) optOutGdbRe = regexp.MustCompile("[<]optimized out[>]") - numberColonRe = regexp.MustCompile("^ *\\d+:") + numberColonRe = regexp.MustCompile(`^ *\d+:`) ) var gdb = "gdb" // Might be "ggdb" on Darwin, because gdb no longer part of XCode