Commit 3a3093d5 authored by Jay Conrod's avatar Jay Conrod

cmd/go: document 'go env GOMOD' outside modules

In documentation for 'go env GOMOD', note that the path will be
os.DevNull in module-aware mode when no go.mod file is present.

Fixes #36052

Change-Id: I30ced1df02ccefe1970bd856190e79d6f0384375
Reviewed-on: https://go-review.googlesource.com/c/go/+/210577
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
parent 7d24e958
......@@ -1726,8 +1726,10 @@
// GOHOSTOS
// The operating system (GOOS) of the Go toolchain binaries.
// GOMOD
// The absolute path to the go.mod of the main module,
// or the empty string if not using modules.
// The absolute path to the go.mod of the main module.
// If module-aware mode is enabled, but there is no go.mod, GOMOD will be
// os.DevNull ("/dev/null" on Unix-like systems, "NUL" on Windows).
// If module-aware mode is disabled, GOMOD will be the empty string.
// GOTOOLDIR
// The directory where the go tools (compile, cover, doc, etc...) are installed.
//
......
......@@ -621,8 +621,10 @@ Additional information available from 'go env' but not read from the environment
GOHOSTOS
The operating system (GOOS) of the Go toolchain binaries.
GOMOD
The absolute path to the go.mod of the main module,
or the empty string if not using modules.
The absolute path to the go.mod of the main module.
If module-aware mode is enabled, but there is no go.mod, GOMOD will be
os.DevNull ("/dev/null" on Unix-like systems, "NUL" on Windows).
If module-aware mode is disabled, GOMOD will be the empty string.
GOTOOLDIR
The directory where the go tools (compile, cover, doc, etc...) are installed.
`,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment