go mod init 报错

go mod init  projectName

go mod init  会报错:

go: cannot determine module path for source directory /xxx/xxx/xxx/name (outside GOPATH, module path must be specified)

原文地址:https://www.cnblogs.com/winyh/p/14821317.html