diff options
author | Russ Cox <rsc@golang.org> | 2019-04-22 23:01:26 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2019-04-23 14:21:30 +0000 |
commit | b51c157025c1ff08b5090d9cf13bc88a068c5190 (patch) | |
tree | 29194d730435554ec96446d8ced7c7372b0921f5 /src/runtime/debug.go | |
parent | fac3b5d05ecf31a2491949cc905312a34e272ae8 (diff) | |
download | go-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.go')
-rw-r--r-- | src/runtime/debug.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/runtime/debug.go b/src/runtime/debug.go index 06bf0fa831..af5c3a1170 100644 --- a/src/runtime/debug.go +++ b/src/runtime/debug.go @@ -57,3 +57,8 @@ func NumCgoCall() int64 { func NumGoroutine() int { return int(gcount()) } + +//go:linkname debug_modinfo runtime/debug.modinfo +func debug_modinfo() string { + return modinfo +} |