-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: Module mode doesn't turn on automatically while build upon relative path #34043
Comments
Please provide concrete steps to reproduce the problem. Specifically, please provide the exact commands run, including any Note that the |
My understanding reading this is: I must call This is surprising to me. Is there a flag to give to |
https://golang.org/cmd/go/#hdr-The_main_module_and_the_build_list
No. (The argument to |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
go mod init
// convert the project to the module-basedgo build ./src/cli/project/"
// from a relative directory../src/cli/project
isn't inGOPATH
(that's why I'm using module).What did you expect to see?
It should build successfully via module mode.
(If
go build
directly in the project folder it will detect thego.mod
file and use module mode to build successfully)What did you see instead?
src/cli/project/main.go:4:2: cannot find package "project/cmd" in any of:
/usr/local/go/src/project/cmd (from $GOROOT)
/Users/FOOBAR/go/src/project/cmd (from $GOPATH)
The text was updated successfully, but these errors were encountered: