Skip to content

Commit

Permalink
Merge pull request #25847 from vespa-engine/arnej/avoid-using-copy-as…
Browse files Browse the repository at this point in the history
…-function-name

avoid hiding built-in function "copy"
  • Loading branch information
mpolden authored Feb 2, 2023
2 parents dff8e9c + 6fe5af1 commit 2754ecf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/go/cmd/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (c *cloner) Clone(applicationName, path string) error {
}
found = true

if err := copy(f, path, dirPrefix); err != nil {
if err := copyFromZip(f, path, dirPrefix); err != nil {
return fmt.Errorf("could not copy zip entry '%s': %w", color.CyanString(f.Name), err)
}
}
Expand Down Expand Up @@ -259,7 +259,7 @@ func trimEntityTagID(s string) string {
return strings.TrimSuffix(strings.TrimPrefix(s, `W/"`), `"`)
}

func copy(f *zip.File, destinationDir string, zipEntryPrefix string) error {
func copyFromZip(f *zip.File, destinationDir string, zipEntryPrefix string) error {
destinationPath := filepath.Join(destinationDir, filepath.FromSlash(strings.TrimPrefix(f.Name, zipEntryPrefix)))
if strings.HasSuffix(f.Name, "/") {
if f.Name != zipEntryPrefix { // root is already created
Expand Down

0 comments on commit 2754ecf

Please sign in to comment.