diff options
author | Damian Gryski <[email protected]> | 2022-08-05 13:36:13 -0700 |
---|---|---|
committer | Ron Evans <[email protected]> | 2022-08-07 10:32:23 +0200 |
commit | 1784bcd7282aa247aa7fd4a2d3478c920cecdbcf (patch) | |
tree | 5d00f5a7e6437b61b04838ef76149f0b89f195d9 | |
parent | a2704f1435c8c26e072f036c32820571498b9052 (diff) | |
download | tinygo-1784bcd7282aa247aa7fd4a2d3478c920cecdbcf.tar.gz tinygo-1784bcd7282aa247aa7fd4a2d3478c920cecdbcf.zip |
compileopts: use backticks for regexp to avoid extra escapes
-rw-r--r-- | compileopts/config.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compileopts/config.go b/compileopts/config.go index 32a5d4f08..7cf2f766a 100644 --- a/compileopts/config.go +++ b/compileopts/config.go @@ -440,13 +440,13 @@ func (c *Config) OpenOCDConfiguration() (args []string, err error) { if openocdInterface == "" { return nil, errors.New("OpenOCD programmer not set") } - if !regexp.MustCompile("^[\\p{L}0-9_-]+$").MatchString(openocdInterface) { + if !regexp.MustCompile(`^[\p{L}0-9_-]+$`).MatchString(openocdInterface) { return nil, fmt.Errorf("OpenOCD programmer has an invalid name: %#v", openocdInterface) } if c.Target.OpenOCDTarget == "" { return nil, errors.New("OpenOCD chip not set") } - if !regexp.MustCompile("^[\\p{L}0-9_-]+$").MatchString(c.Target.OpenOCDTarget) { + if !regexp.MustCompile(`^[\p{L}0-9_-]+$`).MatchString(c.Target.OpenOCDTarget) { return nil, fmt.Errorf("OpenOCD target has an invalid name: %#v", c.Target.OpenOCDTarget) } if c.Target.OpenOCDTransport != "" && c.Target.OpenOCDTransport != "swd" { |