aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/dist/build.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/dist/build.go')
-rw-r--r--src/cmd/dist/build.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
index e4250e12de..91ea7eb498 100644
--- a/src/cmd/dist/build.go
+++ b/src/cmd/dist/build.go
@@ -737,7 +737,7 @@ func runInstall(pkg string, ch chan struct{}) {
// Start final link command line.
// Note: code below knows that link.p[targ] is the target.
var (
- link []string
+ link = make([]string, 0, 1)
targ int
ispackcmd bool
)
@@ -1967,7 +1967,7 @@ func cmdlist() {
brokenFlag := flag.Bool("broken", false, "include broken ports")
xflagparse(0)
- var plats []string
+ plats := make([]string, 0, len(cgoEnabled))
for p := range cgoEnabled {
if broken[p] && !*brokenFlag {
continue
@@ -1990,7 +1990,7 @@ func cmdlist() {
FirstClass bool
Broken bool `json:",omitempty"`
}
- var results []jsonResult
+ results := make([]jsonResult, 0, len(plats))
for _, p := range plats {
fields := strings.Split(p, "/")
results = append(results, jsonResult{