diff --git a/src/cmd/dist/buildruntime.go b/src/cmd/dist/buildruntime.go index c1a9b817f88..6e802219bab 100644 --- a/src/cmd/dist/buildruntime.go +++ b/src/cmd/dist/buildruntime.go @@ -16,12 +16,11 @@ import ( // mkzversion writes zversion.go: // -// package runtime +// package sys // const DefaultGoroot = // const TheVersion = // const Goexperiment = // const StackGuardMultiplier = -// const BuildVersion = // func mkzversion(dir, file string) { out := fmt.Sprintf( @@ -32,8 +31,7 @@ func mkzversion(dir, file string) { "const DefaultGoroot = `%s`\n"+ "const TheVersion = `%s`\n"+ "const Goexperiment = `%s`\n"+ - "const StackGuardMultiplier = %d\n\n"+ - "var BuildVersion = TheVersion\n", goroot_final, findgoversion(), os.Getenv("GOEXPERIMENT"), stackGuardMultiplier()) + "const StackGuardMultiplier = %d\n\n", goroot_final, findgoversion(), os.Getenv("GOEXPERIMENT"), stackGuardMultiplier()) writefile(out, file, writeSkipSame) } diff --git a/src/runtime/proc.go b/src/runtime/proc.go index d75af10206e..04e4c7c5481 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -10,6 +10,8 @@ import ( "unsafe" ) +var buildVersion = sys.TheVersion + // Goroutine scheduler // The scheduler's job is to distribute ready-to-run goroutines over worker threads. // @@ -445,10 +447,10 @@ func schedinit() { throw("unknown runnable goroutine during bootstrap") } - if sys.BuildVersion == "" { + if buildVersion == "" { // Condition should never trigger. This code just serves // to ensure runtimeĀ·buildVersion is kept in the resulting binary. - sys.BuildVersion = "unknown" + buildVersion = "unknown" } }