diff options
author | Eng Zer Jun <engzerjun@gmail.com> | 2022-05-09 19:26:05 +0800 |
---|---|---|
committer | Eng Zer Jun <engzerjun@gmail.com> | 2022-05-09 19:45:40 +0800 |
commit | 7873c27cfbd812dca60d90367d375bbae5a27014 (patch) | |
tree | 2f5d18783ac58536681d39b6e9baa0fd349cdba1 /distribution | |
parent | bb88ff4ab44c0e030bcd02ee364c66cdb5cef5a4 (diff) | |
download | docker-7873c27cfbd812dca60d90367d375bbae5a27014.tar.gz |
all: 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>
Diffstat (limited to 'distribution')
-rw-r--r-- | distribution/manifest_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/distribution/manifest_test.go b/distribution/manifest_test.go index 2edaa762aa..52b7c3e676 100644 --- a/distribution/manifest_test.go +++ b/distribution/manifest_test.go @@ -126,7 +126,7 @@ func TestManifestStore(t *testing.T) { dgst := digest.Canonical.FromBytes(serialized) setupTest := func(t *testing.T) (specs.Descriptor, *mockManifestGetter, *manifestStore, content.Store, func(*testing.T)) { - root, err := os.MkdirTemp("", strings.Replace(t.Name(), "/", "_", -1)) + root, err := os.MkdirTemp("", strings.ReplaceAll(t.Name(), "/", "_")) assert.NilError(t, err) defer func() { if t.Failed() { |