mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
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:
committed by
Nick Craig-Wood
parent
b929a56f46
commit
4f0ddb60e7
@@ -317,7 +317,7 @@ func (r *Run) RemoveTestBinary() {
|
||||
func (r *Run) Name() string {
|
||||
ns := []string{
|
||||
r.Backend,
|
||||
strings.Replace(r.Path, "/", ".", -1),
|
||||
strings.ReplaceAll(r.Path, "/", "."),
|
||||
r.Remote,
|
||||
}
|
||||
if r.FastList {
|
||||
@@ -325,7 +325,7 @@ func (r *Run) Name() string {
|
||||
}
|
||||
ns = append(ns, fmt.Sprintf("%d", r.Try))
|
||||
s := strings.Join(ns, "-")
|
||||
s = strings.Replace(s, ":", "", -1)
|
||||
s = strings.ReplaceAll(s, ":", "")
|
||||
return s
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user