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 11:08:37 +01:00
committed by Nick Craig-Wood
parent b929a56f46
commit 4f0ddb60e7
20 changed files with 32 additions and 32 deletions
+1 -1
View File
@@ -562,7 +562,7 @@ func (f *Fs) list(ctx context.Context, filter api.SearchFilter, fn listFn) (err
for i := range items {
item := &result.MediaItems[i]
remote := item.Filename
remote = strings.Replace(remote, "/", "/", -1)
remote = strings.ReplaceAll(remote, "/", "/")
err = fn(remote, item, false)
if err != nil {
return err