air执行出错,提示需要go mod init

根据装教程上的写下,安装air后执行出现问题

go: cannot find main module, but found .git/config in /Users/mac/Code/go/src/github.com/weiyechaocat/goblog
        to create a module there, run:
        go mod init
failed to build, error: exit status 1

我的golang安装在/usr/local/go
我的项目目录为/User/mac/Code/go
看站长的项目路径也是自定义,不知安装路径是在哪里

讨论数量: 2

在项目目录下执行go mod init

3年前 评论
Noctis (楼主) 3年前

+1,出现了一样的问题。咱们的summer站长日理万机,没空回复啊。

3年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!