1.18 需要先执行 `go mod init` 否则运行不起来

1.18 需要先执行 go mod init 否则运行不起来。

$ air

  __    _   ___  
 / /\  | | | |_) 
/_/--\ |_| |_| \_ , built with Go 

watching .
!exclude tmp
building...
go: cannot find main module, but found .git/config in /home/wanger/code/go/src/wangdeer/goblog
    to create a module there, run:
    go mod init
failed to build, error: exit status 1
^Ccleaning...
see you again~
黑哈尔
讨论数量: 1

项目问题都没人解决,特别对我门这种初学这个的人不友好,查到烦了

1年前 评论

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