We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
必须设置go env GO111MODULE=on
The text was updated successfully, but these errors were encountered:
你好,对于 GO111MODULE 这个环境变量来说的话,它的默认值目前还是 "auto",本来是有改成默认 "on" 的,但由于一些问题(详见:go/issues#31857)又改了回去。所以,估计 Go 1.14 还是很可能继续维持 "auto"。
GO111MODULE
但是,在 Go 1.13 中 "auto" 的含义有所变化。过去在 Go 1.11 和 Go 1.12 中,只有在当前项目不处于 GOPATH 并且包含了 go.mod 文件时才会启用 Modules 组件。而 Go 1.13 则是忽略了 GOPATH,只根据有无 go.mod 文件来判断是否启用。所以如果恰好你的项目中不包含 go.mod 文件,且还处于 GOPATH 中,那么 go 是会当成 GO111MODULE=off 的状态来构建代码的,此时走的就是传统方式了。
GOPATH
go.mod
go
GO111MODULE=off
当然,显式地将 GO111MODULE 设置为 "on",肯定是很好的,这样子你就算是全面切入 Modules 了,我从 Go 1.11 开始就已经是这么做了。
看来是需要在 README 里说明白这一点了。
Sorry, something went wrong.
c04e2cc
No branches or pull requests
必须设置go env GO111MODULE=on
The text was updated successfully, but these errors were encountered: