简体   繁体   中英

IntelliJ Golang plugin not able to import default packages

I just downloaded the latest plugin for Go support in IntelliJ. I'm not able to use intellisense for Go programming because IntelliJ is not able to import packages like fmt and float64.

However, if I run the program from within IntelliJ, it works just fine!

GOROOT is usr/local/go Project GOPATH is /Users/myname/go where the go file is.

What am I missing?

在此处输入图片说明

Go to Settings | Languages & Frameworks | Go | GOROOT and make sure your GOROOT is selected there. Then to the same place, but in GOPATH, make sure that's also set correctly.

Also, make sure that you follow the Go Workspace requirements.

我通过将IntelliJ IDEA升级到最新版本解决了这个问题。

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