Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / compilers / go / remove-tools-1.11.patch
blobcff35999a8322afbfc44d26844cf8b7606925ede
1 diff --git a/src/go/build/build.go b/src/go/build/build.go
2 index b68a712..b60bf19 100644
3 --- a/src/go/build/build.go
4 +++ b/src/go/build/build.go
5 @@ -1708,7 +1708,7 @@ func init() {
8 // ToolDir is the directory containing build tools.
9 -var ToolDir = getToolDir()
10 +var ToolDir = runtime.GOTOOLDIR()
12 // IsLocalImport reports whether the import path is
13 // a local import path, like ".", "..", "./foo", or "../foo".
14 diff --git a/src/runtime/extern.go b/src/runtime/extern.go
15 index 7171b13..18a942c 100644
16 --- a/src/runtime/extern.go
17 +++ b/src/runtime/extern.go
18 @@ -229,6 +229,17 @@ func GOROOT() string {
19 return sys.DefaultGoroot
22 +// GOTOOLDIR returns the root of the Go tree.
23 +// It uses the GOTOOLDIR environment variable, if set,
24 +// or else the root used during the Go build.
25 +func GOTOOLDIR() string {
26 + s := gogetenv("GOTOOLDIR")
27 + if s != "" {
28 + return s
29 + }
30 + return GOROOT() + "/pkg/tool/" + GOOS + "_" + GOARCH
33 // Version returns the Go tree's version string.
34 // It is either the commit hash and date at the time of the build or,
35 // when possible, a release tag like "go1.3".