aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/debug
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2019-04-22 23:01:26 -0400
committerRuss Cox <rsc@golang.org>2019-04-23 14:21:30 +0000
commitb51c157025c1ff08b5090d9cf13bc88a068c5190 (patch)
tree29194d730435554ec96446d8ced7c7372b0921f5 /src/runtime/debug
parentfac3b5d05ecf31a2491949cc905312a34e272ae8 (diff)
downloadgo-b51c157025c1ff08b5090d9cf13bc88a068c5190.tar.gz
go-b51c157025c1ff08b5090d9cf13bc88a068c5190.zip
cmd/go: move runtime/debug.modinfo to runtime.modinfo
It is easier to ensure that the symbol is always present if we move it to package runtime. Avoids init-time work. Also moves it next to buildVersion, the other similar symbol. Setting up for "go version <binary>". For #31624. Change-Id: I943724469ce6992153e701257eb6f12da88c8e4e Reviewed-on: https://go-review.googlesource.com/c/go/+/173341 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/runtime/debug')
-rw-r--r--src/runtime/debug/mod.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/debug/mod.go b/src/runtime/debug/mod.go
index 2c5aa27b6e..e3b929a977 100644
--- a/src/runtime/debug/mod.go
+++ b/src/runtime/debug/mod.go
@@ -8,14 +8,14 @@ import (
"strings"
)
-// set using cmd/go/internal/modload.ModInfoProg
-var modinfo string
+// exported from runtime
+func modinfo() string
// ReadBuildInfo returns the build information embedded
// in the running binary. The information is available only
// in binaries built with module support.
func ReadBuildInfo() (info *BuildInfo, ok bool) {
- return readBuildInfo(modinfo)
+ return readBuildInfo(modinfo())
}
// BuildInfo represents the build information read from