summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorZhizhen He <hezhizhen.yi@gmail.com>2024-05-18 16:06:33 +0800
committerGitHub <noreply@github.com>2024-05-18 17:06:33 +0900
commit01e7668915c4e3cf8c9eeca283d41beac924fe1f (patch)
tree721306578106c58da6cdb0c04543eaba53b7d5a1 /src/util
parent0994d9c881f8380997b96bb0a4a7416b50bc2b0d (diff)
chore: use strings.ReplaceAll (#3801)
Diffstat (limited to 'src/util')
-rw-r--r--src/util/util_windows.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/util_windows.go b/src/util/util_windows.go
index 3a4ab570..d9db8342 100644
--- a/src/util/util_windows.go
+++ b/src/util/util_windows.go
@@ -157,10 +157,10 @@ func (x *Executor) QuoteEntry(entry string) string {
*/
return escapeArg(entry)
case shellTypePowerShell:
- escaped := strings.Replace(entry, `"`, `\"`, -1)
- return "'" + strings.Replace(escaped, "'", "''", -1) + "'"
+ escaped := strings.ReplaceAll(entry, `"`, `\"`)
+ return "'" + strings.ReplaceAll(escaped, "'", "''") + "'"
default:
- return "'" + strings.Replace(entry, "'", "'\\''", -1) + "'"
+ return "'" + strings.ReplaceAll(entry, "'", "'\\''") + "'"
}
}