Go环境异常问题go: go.mod file not found in current directory or any parent directory; see ‘go help modules
高版本go(1.17)执行时错误: go: go.mod file not found in current directory or any parent directory; see ‘go help modules’…
解决:参考链接:
https://blog.golang.org/go116-module-changes
再1.16进行了module变更。
所以高版本需要设置一下 :
go env -w GO111MODULE=auto
再次运行程序即可。