aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/extern.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2021-01-27 10:47:38 -0500
committerRuss Cox <rsc@golang.org>2021-02-19 00:01:45 +0000
commita78879ac67d62c4919492fcb5e05c8b21058217d (patch)
tree118e7a544b2c68e0900cf27b505daa40503df54a /src/runtime/extern.go
parent8ac23a1f151a9b1842797652ed7761f397055b5b (diff)
downloadgo-a78879ac67d62c4919492fcb5e05c8b21058217d.tar.gz
go-a78879ac67d62c4919492fcb5e05c8b21058217d.zip
runtime: move sys.DefaultGoroot to runtime.defaultGOROOT
The default GOROOT has nothing to do with system details. Move it next to its one use in package runtime. This CL is part of a stack adding windows/arm64 support (#36439), intended to land in the Go 1.17 cycle. This CL is, however, not windows/arm64-specific. It is cleanup meant to make the port (and future ports) easier. Change-Id: I1a601fad6335336b4616b834bb21bd8437ee1313 Reviewed-on: https://go-review.googlesource.com/c/go/+/288796 Trust: Russ Cox <rsc@golang.org> Trust: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/runtime/extern.go')
-rw-r--r--src/runtime/extern.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/runtime/extern.go b/src/runtime/extern.go
index dacdf4f383..bbe41dd0d4 100644
--- a/src/runtime/extern.go
+++ b/src/runtime/extern.go
@@ -229,6 +229,8 @@ func Callers(skip int, pc []uintptr) int {
return callers(skip, pc)
}
+var defaultGOROOT string // set by cmd/link
+
// GOROOT returns the root of the Go tree. It uses the
// GOROOT environment variable, if set at process start,
// or else the root used during the Go build.
@@ -237,7 +239,7 @@ func GOROOT() string {
if s != "" {
return s
}
- return sys.DefaultGoroot
+ return defaultGOROOT
}
// Version returns the Go tree's version string.