From 01e7668915c4e3cf8c9eeca283d41beac924fe1f Mon Sep 17 00:00:00 2001 From: Zhizhen He Date: Sat, 18 May 2024 16:06:33 +0800 Subject: chore: use strings.ReplaceAll (#3801) --- src/util/util_windows.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/util') 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, "'", "'\\''") + "'" } } -- cgit v1.2.3