Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go: bad error when GOROOT not set correctly #34769
Bad GOROOT is not diagnosed particularly well:
The first error is great. The second error is not. It should diagnose the bad GOROOT setting not complain about malformed module paths.
FWIW GOPATH mode is bad too but differently:
…strings In CL 203820, we switched go/build to use the caller's working directory for the main module (rather than srcDir), so that go/build resolution now respects the requirements and replacements of the main module. When the passed-in srcDir is empty, as of that CL we use "go list" instead of falling back to in-process (GOPATH-mode) path lookup. Unfortunately, that broke go/build.TestImportDirNotExist when GO111MODULE=on: the test was looking for the specific error message produced by the in-process lookup. This change relaxes the test to accept the error message produced by "go list" when srcDir is empty. Updates #34769 Updates #34860 Updates #35734 Fixes #36867 Change-Id: Id0f7814a4b7dabe8917216eb013bb4eaee283648 Reviewed-on: https://go-review.googlesource.com/c/go/+/216817 Run-TryBot: Bryan C. Mills <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org> Reviewed-by: Jay Conrod <email@example.com>