go: go.mod file not found in current directory or any parent directory; see ‘go help modules‘

内容分享2天前发布
0 0 0

  vscode  环境重新部署 调试程序出现报错 go: go.mod file not found in current directory or any parent directory; see ‘go help modules‘

go mod init [包名或目录名] 

例如 

go mod init hello

go: creating new go.mod: module hello

go: to add module requirements and sums:

        go mod tidy

问题解决

关于 go env 中  GO111MODULE 未开启

set GO111MODULE=

可以设置为 

 auto

go env -w GO111MODULE=auto

但不是上面问题的诱因

© 版权声明

相关文章

暂无评论

none
暂无评论...