首页 > 其他 > 详细

踩坑 Go1.6+ install报错go: go.mod file not found

时间:2021-09-05 16:31:35      阅读:37      评论:0      收藏:0      [点我收藏+]

最近在用go写一个简单的JVM虚拟机,在编译的时候,使用go install,然后命令行提醒

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

当前目录或父目录找不到go.mod文件

只要在你项目源码目录执行下面的命令就可以解决这个问题

go mod init

go会在这个目录下,创建一个go.mod的文件。

再执行go install 就可以成功了

踩坑 Go1.6+ install报错go: go.mod file not found

原文:https://www.cnblogs.com/inkyi/p/15226634.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!