如何解决go.mod file not found in current directory or any parent directory?

Environment variable configuration:

If the installation path is:/usr/local/go

Then configure the environment variables like this:

vi ~/.bash_profile

export GOPATH=$HOME/go

Then save and execute source ~/.bash_profile

报错go.mod file not found in current directory or any parent directory?

solve:go env -w GO111MODULE=auto

OK, problem solved

Guess you like

Origin blog.csdn.net/BenChiZhuBaDaoWang/article/details/131506506