I use IntelliJ IDEA as golang IDE, and system environment have already set GOPATH,But IDEA can't load it

前端 未结 6 1066
眼角桃花
眼角桃花 2021-01-31 10:15

I use IntelliJ IDEA as golang IDE in Windows , and system environment have already set GOPATH,but IDEA can\'t load $GOPATH.

I use go get github.com/astaxie/beego

6条回答
  •  南旧
    南旧 (楼主)
    2021-01-31 10:33

    I don't use IntelliJ, but i have a similar issue with Eclipse. I'm probably doing something wrong but Eclipse does not recognize the GOPATH env variable by itself.

    What I do is adding manually to the Go settings an entry to the library i am using. For example it would looks like /somewhere/in/your/hd/github.com/astaxie/beego. Note that you have to specify the base directory of your library, not the /src or /pkg folder.

    Hope this helps.

提交回复
热议问题