refactor: replace strings.Replace with strings.ReplaceAll

strings.ReplaceAll(s, old, new) is a wrapper function for
strings.Replace(s, old, new, -1). But strings.ReplaceAll is more
readable and removes the hardcoded -1.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun
2022-05-17 00:11:45 +08:00
committed by Nick Craig-Wood
parent b929a56f46
commit 4f0ddb60e7
20 changed files with 32 additions and 32 deletions

View File

@@ -2966,7 +2966,7 @@ func (f *Fs) Precision() time.Duration {
// pathEscape escapes s as for a URL path. It uses rest.URLPathEscape
// but also escapes '+' for S3 and Digital Ocean spaces compatibility
func pathEscape(s string) string {
return strings.Replace(rest.URLPathEscape(s), "+", "%2B", -1)
return strings.ReplaceAll(rest.URLPathEscape(s), "+", "%2B")
}
// copy does a server-side copy