mirror of
https://github.com/golang/go
synced 2024-09-25 05:20:13 -06:00
cmd/doc: treat any non-empty GOMOD as module mode
Previously, we were looking for the string go.mod specifically, but the module-mode-outside-a-module logic added in CL 148517 sets GOMOD to os.DevNull Updates #28992 Change-Id: I62a4baaa911a495350294d78bae96be3fe4866cb Reviewed-on: https://go-review.googlesource.com/c/151617 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
c37b6ecc8a
commit
ec4de31c5c
@ -162,7 +162,7 @@ func findCodeRoots() []Dir {
|
||||
// Check for use of modules by 'go env GOMOD',
|
||||
// which reports a go.mod file path if modules are enabled.
|
||||
stdout, _ := exec.Command("go", "env", "GOMOD").Output()
|
||||
usingModules = bytes.Contains(stdout, []byte("go.mod"))
|
||||
usingModules = len(bytes.TrimSpace(stdout)) > 0
|
||||
}
|
||||
|
||||
if !usingModules {
|
||||
|
Loading…
Reference in New Issue
Block a user