Error message "go: go.mod file not found in current directory or any parent directory; see 'go help modules'"
13 May 2020, 05:22 UTC
I just updated to the new version of Go - Go version 1.16.2 Linux/amd64 and am getting an error when I build a Hello, World! example:
go: go.mod file not found in current directory or any parent directory; see 'go help modules'
Even when I follow the fix from this post it isn't working. I set these variables and then build again:
GO111MODULE=on
GOPROXY=https://proxy.golang.org,direct
And the same problem unfortunately.
1 answer
Accepted answer · original discussion
17 May 2020, 17:22 UTC
Yes, just follow the tutorial and for me that was doing go mod init test3 to create a module. No one else has been upgrading from the old version or everyone else just understood it properly I guess.
2 question comments
Use comments to ask for clarification. Post a solution as an answer.
14 May 2020, 17:22 UTC
16 May 2020, 05:22 UTC