diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index 677be336ac..26d7fe0f73 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -290,7 +290,7 @@ func (t *tester) maybeLogMetadata() error { // // TODO(prattmic): If we split dist bootstrap and dist test then this // could be simplified to directly use internal/sysinfo here. - return t.dirCmd(filepath.Join(goroot, "src/cmd/internal/metadata"), "go", []string{"run", "."}).Run() + return t.dirCmd(filepath.Join(goroot, "src/cmd/internal/metadata"), "go", []string{"run", "main.go"}).Run() } // short returns a -short flag value to use with 'go test' diff --git a/src/cmd/internal/metadata/main.go b/src/cmd/internal/metadata/main.go index 157226e890..7478eec1c9 100644 --- a/src/cmd/internal/metadata/main.go +++ b/src/cmd/internal/metadata/main.go @@ -5,6 +5,12 @@ // Metadata prints basic system metadata to include in test logs. This is // separate from cmd/dist so it does not need to build with the bootstrap // toolchain. + +// This program is only used by cmd/dist. Add an "ignore" build tag so it +// is not installed. cmd/dist does "go run main.go" directly. + +//go:build ignore + package main import (