]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: document 'go env GOMOD' outside modules
authorJay Conrod <jayconrod@google.com>
Mon, 9 Dec 2019 19:29:29 +0000 (14:29 -0500)
committerJay Conrod <jayconrod@google.com>
Mon, 9 Dec 2019 21:50:59 +0000 (21:50 +0000)
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: Bryan C. Mills <bcmills@google.com>
src/cmd/go/alldocs.go
src/cmd/go/internal/help/helpdoc.go

index 87c82b16de1144c04ea4f4a910d755093aac35b1..54e7a8b5b300edb89ae7c0cda580a1aa1578a1a6 100644 (file)
 //     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.
 //
index ac16312aaf437d46da883a9e2fcc31df29b8431c..6a843f459a8dd994338ef864ed65f939b28d3080 100644 (file)
@@ -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.
        `,