当前位置:数据分析 > go: go.mod file not found in current directory or any parent directory; see ‘go help modules‘

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

  • 发布:2023-09-28 12:58

问题描述

今天开始接触新的语言-Go语言,但是在起步的时候总是碰壁!!!就在跑程序的时候就给我报了一个这个!!
go: go.mod file not found in current directory or any parent directory; see ‘go help modules‘

弄的我真的很头大!!!所以我查阅别的博主的优秀文章之后,做出下面的解决办法!

解决问题

第一步:首先先检查一下的go 生产环境是不是正确的

  go env

第二步:在cmd窗口输入 go env -w GO111MODULE=auto

go env -w GO111MODULE=auto

第三步:然后我们在查看一下 go env

相关文章