]> Cypherpunks repositories - gostls13.git/commitdiff
os: use slices.Clone
authorTobias Klauser <tklauser@distanz.ch>
Fri, 14 Mar 2025 13:07:45 +0000 (14:07 +0100)
committerGopher Robot <gobot@golang.org>
Sat, 15 Mar 2025 20:07:33 +0000 (13:07 -0700)
Change-Id: I5a3de1b2fe2ebbb6437df5e7cc55e0d8d69c9cd7
Reviewed-on: https://go-review.googlesource.com/c/go/+/657915
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
src/os/root.go

index 2edf5c27f249882d82c8fdeafb42238a47774ec2..41342fcf53e02a2cdcd1f82b314148e272dff59d 100644 (file)
@@ -223,7 +223,7 @@ func splitPathInRoot(s string, prefix, suffix []string) (_ []string, err error)
                suffix = nil
        }
 
-       parts := append([]string{}, prefix...)
+       parts := slices.Clone(prefix)
        i, j := 0, 1
        for {
                if j < len(s) && !IsPathSeparator(s[j]) {