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

前端 未结 6 928
眼角桃花
眼角桃花 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:25

    IDEA plugin for Go does not understand GOPATH as it is defined by Go conventions, it uses only GOROOT, which is determined from SDK. The best workaround is to make symbolic links in GOROOT to packages in GOPATH:

    $GOPATH/src/github.com       <--  $GOROOT/src/pkg/github.com
    $GOPATH/src/code.google.com  <--  $GOROOT/src/pkg/code.google.com
    ... etc
    

    It should be possible to do in Windows too.

提交回复
热议问题