1,在goland中新建 go项目,重新选择项目所在文件夹
2,在terminal 里运行
go mod init 项目名称
go mod vendor
go mod tidy
The commands are:
download download modules to local cache
edit edit go.mod from tools or scripts
graph print module requirement graph
init initialize new module in current directory //初始化
tidy add missing and remove unused modules //整理modules
vendor make vendored copy of dependencies //拷贝
verify verify dependencies have expected content
why explain why packages or modules are needed