Technical questionAccepted answer
Error message "go: go.mod file not found in current directory or any parent directory; see 'go help modules'"
asker152
Mar 31
0 views1
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
asker152
PermalinkApr 1
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.
Mr_PinkPermalink
Mar 31
VolkerPermalink
Mar 31
Read and stick to golang.org/doc/#getting-started. You must use modules in Go 1.16.