Contents:
GO111Module
did not find expected key
在 Go 1.15 以及早期版本, GO111Module 默认设置为 auto 。这意味着,如果项目目录(或任何父目录)包含一个 go.mod 文件,则被视为一个模块(module)。甚至在使用传统的 GOPATH 模式。
auto
go.mod
GOPATH
在 Go 1.16 ,这个模块感知模式被切换成 GO111MODULE=on ,对使用第三方模块以及自己编写的模块有如下影响:
GO111MODULE=on
Using Modules and Packages in Go - Learn what has changed in Go 1.16