build: use slices.Clone for copying slice (#30716)

pull/30296/merge
zhiqiangxu 2 days ago committed by GitHub
parent a1093d98eb
commit c48e936b70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      build/ci.go

@ -53,6 +53,7 @@ import (
"path"
"path/filepath"
"runtime"
"slices"
"strings"
"time"
@ -226,8 +227,7 @@ func doInstall(cmdline []string) {
// Do the build!
for _, pkg := range packages {
args := make([]string, len(gobuild.Args))
copy(args, gobuild.Args)
args := slices.Clone(gobuild.Args)
args = append(args, "-o", executablePath(path.Base(pkg)))
args = append(args, pkg)
build.MustRun(&exec.Cmd{Path: gobuild.Path, Args: args, Env: gobuild.Env})

Loading…
Cancel
Save