Skip to content

Commit 011b6ff

Browse files
committed
cmd/go: document go env GOMOD
Fixes #26500. Change-Id: I0a00009ce10f7aab3e6e79f7218307c3008422d1 Reviewed-on: https://go-review.googlesource.com/125655 Reviewed-by: Bryan C. Mills <[email protected]>
1 parent 8fbbf63 commit 011b6ff

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/cmd/go/internal/help/helpdoc.go

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -501,10 +501,6 @@ General-purpose environment variables:
501501
GOTMPDIR
502502
The directory where the go command will write
503503
temporary source files, packages, and binaries.
504-
GOTOOLDIR
505-
The directory where the go tools (compile, cover, doc, etc...)
506-
are installed. This is printed by go env, but setting the
507-
environment variable has no effect.
508504
509505
Environment variables for use with cgo:
510506
@@ -573,6 +569,20 @@ Special-purpose environment variables:
573569
Defined by Git. A colon-separated list of schemes that are allowed to be used
574570
with git fetch/clone. If set, any scheme not explicitly mentioned will be
575571
considered insecure by 'go get'.
572+
573+
Additional information available from 'go env' but not read from the environment:
574+
575+
GOEXE
576+
The executable file name suffix (".exe" on Windows, "" on other systems).
577+
GOHOSTARCH
578+
The architecture (GOARCH) of the Go toolchain binaries.
579+
GOHOSTOS
580+
The operating system (GOOS) of the Go toolchain binaries.
581+
GOMOD
582+
The absolute path to the go.mod of the main module,
583+
or the empty string if not using modules.
584+
GOTOOLDIR
585+
The directory where the go tools (compile, cover, doc, etc...) are installed.
576586
`,
577587
}
578588

0 commit comments

Comments
 (0)