go: cannot determine module path for source directory xxx (outside GOPATH, no import comments)
go:无法确定源目录xxx的模块路径(在GOPATH之外,没有导入注释)
解决方法如下:
// 加上module名demo
/xxx > go mod init#返回错误
go: cannot determine module path for source directory xxx (outside GOPATH, no import comments)
/xxx > go mod init demo
go: creating new go.mod: module demo
/xxx > go mod tidy