-
Notifications
You must be signed in to change notification settings - Fork 17.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go: report a helpful error when there are no modules in workspace
The current error message that no go.mod files were found is not helpful, especially when a go.mod file exists in the current directory. Fixes #49594 Change-Id: I750475ce8654eeb3e0a2857d5a2de1a9c6ede415 Reviewed-on: https://go-review.googlesource.com/c/go/+/365319 Trust: Michael Matloob <matloob@golang.org> Run-TryBot: Michael Matloob <matloob@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
- Loading branch information
Showing
4 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
! go build . | ||
stderr 'go: no modules were found in the current workspace; see ''go help work''' | ||
|
||
-- go.work -- | ||
go 1.18 | ||
-- go.mod -- | ||
go 1.18 | ||
|
||
module foo | ||
-- foo.go -- | ||
package main | ||
|
||
func main() {} |