In releases prior to 1.16 the following works.
- mkdir -p $(go env GOPATH)/src/mycode/
- cd $(go env GOPATH)/src/mycode/
- create code.go (empty main is fine)
- go install
Instead of $(go env GOPATH)/bin/mycode
go: cannot find main module; see ‘go help modules’
I tried GO111MODULE=auto and off, got same error.
I read the release notes, and do not see anything directly related (might have missed something though).
If I run
go mod tidy then
go install it works. I understand we are moving to modules, but it seems the release notes are actually lacking the part saying its not optional (unless I am wrong).