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

内容分享6个月前发布
2 0 0
全能 AI 聚合平台 免费

一站式接入主流 AI 大模型,支持对话 · 生图 · 生视频,即开即用

ChatGPT Claude Gemini Grok DeepSeek 通义千问 Ollama
AI对话 AI生图 AI视频
免费使用 →

  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
暂无评论...