在Goland IDE中执行一个非常简单的项目时,我看到以下错误。尝试设置GO111MODULE=on/off/auto..没有任何区别!!任何想法?
日志:
GOROOT=/usr/local/go #gosetup
GOPATH=/Users/<uid>/Documents/workspace/<ws_name> #gosetup
/usr/local/go/bin/go build -o /private/var/folders/jn/kjwpzfrx5f98w9nrkzkw48040000gn/T/___go_build_main_go /Users/<uid>/Documents/workspace/<project>/src/github.com/<github_id>/users-api/main.go #gosetup
main.go:4:2: no required module provides package github.com/<github_id>/users-api/app: working directory is not part of a module
Compilation finished with exit code 1
注意:uid, github_id, ws_name等是实际id的掩码
尝试执行go mod init <your project name>
然后执行go mod tidy