cmd/go: Module mode doesn't turn on automatically while build upon relative path #34043
Labels
FrozenDueToAge
modules
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
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: