When attempting to build a simple "Hello, World!" Go example after updating to Go version 1.16.2, you might encounter the following error:
go: go.mod file not found in current directory or any parent directory; see 'go help modules'
Attempts to resolve the issue using the suggested fix, setting GO111MODULE=on and GOPROXY=https://proxy.golang.org,direct, may not succeed.
To address this problem:
go env -w GO111MODULE=off
The above is the detailed content of Why Do I Get 'go: go.mod file not found' After a Go Update, and How Can I Fix It?. For more information, please follow other related articles on the PHP Chinese website!