错误信息
go: cannot determine module path for source directory /opt/test/hello (outside GOPATH, module path must be specified)
解决办法:指定项目名
go mod init myproject
错误信息
go: cannot determine module path for source directory /opt/test/hello (outside GOPATH, module path must be specified)
解决办法:指定项目名
go mod init myproject