diff options
author | Tommy Nguyen <remyabel@gmail.com> | 2018-08-16 17:04:39 -0400 |
---|---|---|
committer | Tommy Nguyen <remyabel@gmail.com> | 2018-08-16 17:04:39 -0400 |
commit | 52033b32f702d1b0c0157b9dd9ecb77e8ddf82b0 (patch) | |
tree | cabffb2d91d3e8fa50ed40f15305bfd375d70d99 /pkg/commands/os.go | |
parent | a7755ab184031cca783052155d1ba4c8275b51dc (diff) |
Use strings.Replace instead of regexp
Diffstat (limited to 'pkg/commands/os.go')
-rw-r--r-- | pkg/commands/os.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/pkg/commands/os.go b/pkg/commands/os.go index c23b48c82..08db71fbb 100644 --- a/pkg/commands/os.go +++ b/pkg/commands/os.go @@ -5,7 +5,7 @@ import ( "os" "os/exec" "runtime" - "regexp" + "strings" "github.com/davecgh/go-spew/spew" @@ -171,7 +171,6 @@ func (c *OSCommand) PrepareSubProcess(cmdName string, commandArgs ...string) (*e // Quote wraps a message in platform-specific quotation marks func (c *OSCommand) Quote(message string) string { - r := regexp.MustCompile("`") - message = r.ReplaceAllString(message, "\\`") + message = strings.Replace(message, "`", "\\`", -1) return c.Platform.escapedQuote + message + c.Platform.escapedQuote } |