]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: clarify GOROOT return value in documentation
authorGabriel Aszalos <gabriel.aszalos@gmail.com>
Fri, 3 Nov 2017 08:40:52 +0000 (09:40 +0100)
committerRuss Cox <rsc@golang.org>
Fri, 3 Nov 2017 15:52:40 +0000 (15:52 +0000)
The current GOROOT documentation could indicate that changing the
environment variable at runtime would affect the return value of
GOROOT. This is false as the returned value is the one used for the
build. This CL aims to clarify the confusion.

Fixes #22302

Change-Id: Ib68c30567ac864f152d2da31f001a98531fc9757
Reviewed-on: https://go-review.googlesource.com/75751
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/extern.go

index 6e6c674d96a647eb1f88de06c32f228409d59313..66b952780234c074b4e91e09fe1226df225c0ec3 100644 (file)
@@ -212,8 +212,8 @@ func Callers(skip int, pc []uintptr) int {
        return callers(skip, pc)
 }
 
-// GOROOT returns the root of the Go tree.
-// It uses the GOROOT environment variable, if set,
+// 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.
 func GOROOT() string {
        s := gogetenv("GOROOT")