os: use slices.Clone

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>
This commit is contained in:
Tobias Klauser 2025-03-14 14:07:45 +01:00 committed by Gopher Robot
parent 35139d6e45
commit bb6a400028
1 changed files with 1 additions and 1 deletions

View 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]) {