diff options
author | Ian Lance Taylor <iant@golang.org> | 2022-06-27 17:22:53 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2022-06-28 10:19:58 -0700 |
commit | 53c4ef1e3cc103ce5bdf1d9923144e93b523102a (patch) | |
tree | 98640aaaa044b92013716c634fd547d3e919e150 /libgo | |
parent | ad4c44d20ece1fbfb9aced1fbcdab8928d702c73 (diff) | |
download | gcc-53c4ef1e3cc103ce5bdf1d9923144e93b523102a.zip gcc-53c4ef1e3cc103ce5bdf1d9923144e93b523102a.tar.gz gcc-53c4ef1e3cc103ce5bdf1d9923144e93b523102a.tar.bz2 |
libgo: make runtime.Version return a meaningful string
Fixes golang/go#51850
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/414734
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/Makefile.am | 1 | ||||
-rw-r--r-- | libgo/Makefile.in | 1 | ||||
-rw-r--r-- | libgo/go/runtime/extern.go | 10 |
3 files changed, 2 insertions, 10 deletions
diff --git a/libgo/Makefile.am b/libgo/Makefile.am index a5d4b6a..b03e655 100644 --- a/libgo/Makefile.am +++ b/libgo/Makefile.am @@ -568,6 +568,7 @@ s-goroot: Makefile rm -f goroot.go.tmp echo "package runtime" > goroot.go.tmp echo 'var defaultGOROOT = `$(prefix)`' >> goroot.go.tmp + echo 'var buildVersion = `'`cat $(srcdir)/VERSION | sed 1q`' '`$(GOC) --version | sed 1q`'`' >> goroot.go.tmp $(SHELL) $(srcdir)/mvifdiff.sh goroot.go.tmp goroot.go $(STAMP) $@ diff --git a/libgo/Makefile.in b/libgo/Makefile.in index 22f48a5..16ed62a 100644 --- a/libgo/Makefile.in +++ b/libgo/Makefile.in @@ -2780,6 +2780,7 @@ s-goroot: Makefile rm -f goroot.go.tmp echo "package runtime" > goroot.go.tmp echo 'var defaultGOROOT = `$(prefix)`' >> goroot.go.tmp + echo 'var buildVersion = `'`cat $(srcdir)/VERSION | sed 1q`' '`$(GOC) --version | sed 1q`'`' >> goroot.go.tmp $(SHELL) $(srcdir)/mvifdiff.sh goroot.go.tmp goroot.go $(STAMP) $@ diff --git a/libgo/go/runtime/extern.go b/libgo/go/runtime/extern.go index a371d9c..8e22614 100644 --- a/libgo/go/runtime/extern.go +++ b/libgo/go/runtime/extern.go @@ -231,16 +231,6 @@ func GOROOT() string { return defaultGOROOT } -// buildVersion is the Go tree's version string at build time. -// -// If any GOEXPERIMENTs are set to non-default values, it will include -// "X:<GOEXPERIMENT>". -// -// This is set by the linker. -// -// This is accessed by "go version <binary>". -var buildVersion string - // Version returns the Go tree's version string. // It is either the commit hash and date at the time of the build or, // when possible, a release tag like "go1.3". |