Skip to content

Commit

Permalink
build: use slices.Clone for copying slice (#30716)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqiangxu authored and ucwong committed Nov 3, 2024
1 parent 963a31f commit bdd56cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import (
"path/filepath"
"regexp"
"runtime"
"slices"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -254,8 +255,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})
Expand Down

0 comments on commit bdd56cd

Please sign in to comment.