build: use slices.Clone for copying slice (#30716)
This commit is contained in:
parent
a1093d98eb
commit
c48e936b70
|
@ -53,6 +53,7 @@ import (
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -226,8 +227,7 @@ func doInstall(cmdline []string) {
|
||||||
|
|
||||||
// Do the build!
|
// Do the build!
|
||||||
for _, pkg := range packages {
|
for _, pkg := range packages {
|
||||||
args := make([]string, len(gobuild.Args))
|
args := slices.Clone(gobuild.Args)
|
||||||
copy(args, gobuild.Args)
|
|
||||||
args = append(args, "-o", executablePath(path.Base(pkg)))
|
args = append(args, "-o", executablePath(path.Base(pkg)))
|
||||||
args = append(args, pkg)
|
args = append(args, pkg)
|
||||||
build.MustRun(&exec.Cmd{Path: gobuild.Path, Args: args, Env: gobuild.Env})
|
build.MustRun(&exec.Cmd{Path: gobuild.Path, Args: args, Env: gobuild.Env})
|
||||||
|
|
Loading…
Reference in New Issue