关于使用 `air` 后报错的解决方案
报错提示如下
go: cannot find main module, but found .git/config in /Users/username/go/src/github.com/username/goblog
to create a module there, run:
go mod init
此应用依赖 go mod
解决方案有二:
1.在项目目录下执行 go mod init
完成 go mod
初始话;
2.执行 export GO111MODULE=auto
[ 推荐, 我是 Mac ,Windows 不详 ]。
推荐文章: