简体   繁体   中英

Not able to compile simple project in Goland

While executing a very simple project in Goland IDE, I see following errors. Tried setting GO111MODULE=on/off/auto.. Didn't make any difference?! Any idea?

Logs:

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

NOTE: uid, github_id, ws_name etc are masks for actual ids

Try executing go mod init <your project name>

Then execute go mod tidy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM