chore: use slices.Clone for copy slice

This commit is contained in:
alan 2024-11-02 09:08:04 +08:00
parent a1093d98eb
commit 8bb3f413b4

View file

@ -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})