diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 0ddf12a6c5f62e..d907dde4fc8aa7 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -135,11 +135,6 @@ // // -asmflags '[pattern=]arg list' // arguments to pass on each go tool asm invocation. -// -buildinfo -// Whether to stamp binaries with build flags. By default, the compiler name -// (gc or gccgo), toolchain flags (like -gcflags), and environment variables -// containing flags (like CGO_CFLAGS) are stamped into binaries. Use -// -buildinfo=false to omit build information. See also -buildvcs. // -buildmode mode // build mode to use. See 'go help buildmode' for more. // -buildvcs @@ -147,7 +142,7 @@ // version control information is stamped into a binary if the main package // and the main module containing it are in the repository containing the // current directory (if there is a repository). Use -buildvcs=false to -// omit version control information. See also -buildinfo. +// omit version control information. // -compiler name // name of compiler to use, as in runtime.Compiler (gccgo or gc). // -gccgoflags '[pattern=]arg list' diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index 625c8545b4ef48..12e2646d6ba1b1 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -1387,7 +1387,7 @@ func TestLdFlagsLongArgumentsIssue42295(t *testing.T) { for buf.Len() < sys.ExecArgLengthLimit+1 { buf.WriteString(testStr) } - tg.run("run", "-buildinfo=false", "-ldflags", fmt.Sprintf(`-X "main.extern=%s"`, buf.String()), tg.path("main.go")) + tg.run("run", "-ldflags", fmt.Sprintf(`-X "main.extern=%s"`, buf.String()), tg.path("main.go")) if tg.stderr.String() != buf.String() { t.Errorf("strings differ") } diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go index 5b84d8be921179..7f68d7bb62839e 100644 --- a/src/cmd/go/internal/cfg/cfg.go +++ b/src/cmd/go/internal/cfg/cfg.go @@ -25,7 +25,6 @@ import ( // These are general "build flags" used by build and other commands. var ( BuildA bool // -a flag - BuildBuildinfo bool // -buildinfo flag BuildBuildmode string // -buildmode flag BuildBuildvcs bool // -buildvcs flag BuildContext = defaultContext() diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go index a891d601b1d4fd..fca9d5a0a296c8 100644 --- a/src/cmd/go/internal/load/pkg.go +++ b/src/cmd/go/internal/load/pkg.go @@ -2292,7 +2292,7 @@ func (p *Package) setBuildInfo() { // Add command-line flags relevant to the build. // This is informational, not an exhaustive list. // Please keep the list sorted. - if cfg.BuildBuildinfo && !p.Standard { + if !p.Standard { if cfg.BuildASan { appendSetting("-asan", "true") } diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go index 9b1acf987d0569..56648338c553c4 100644 --- a/src/cmd/go/internal/work/build.go +++ b/src/cmd/go/internal/work/build.go @@ -88,11 +88,6 @@ and test commands: -asmflags '[pattern=]arg list' arguments to pass on each go tool asm invocation. - -buildinfo - Whether to stamp binaries with build flags. By default, the compiler name - (gc or gccgo), toolchain flags (like -gcflags), and environment variables - containing flags (like CGO_CFLAGS) are stamped into binaries. Use - -buildinfo=false to omit build information. See also -buildvcs. -buildmode mode build mode to use. See 'go help buildmode' for more. -buildvcs @@ -100,7 +95,7 @@ and test commands: version control information is stamped into a binary if the main package and the main module containing it are in the repository containing the current directory (if there is a repository). Use -buildvcs=false to - omit version control information. See also -buildinfo. + omit version control information. -compiler name name of compiler to use, as in runtime.Compiler (gccgo or gc). -gccgoflags '[pattern=]arg list' @@ -317,7 +312,6 @@ func AddBuildFlags(cmd *base.Command, mask BuildFlagMask) { cmd.Flag.Var((*base.StringsFlag)(&cfg.BuildToolexec), "toolexec", "") cmd.Flag.BoolVar(&cfg.BuildTrimpath, "trimpath", false, "") cmd.Flag.BoolVar(&cfg.BuildWork, "work", false, "") - cmd.Flag.BoolVar(&cfg.BuildBuildinfo, "buildinfo", true, "") cmd.Flag.BoolVar(&cfg.BuildBuildvcs, "buildvcs", true, "") // Undocumented, unstable debugging flags.