intellij $GOPATH $GOROOT fix
idea intellij go plugin does not accept custom GOPATH, this .bashrc function is to synchronize the GOPATH with GOROOT.
Requires GOPATH and GOROOT pre defined. Replace linux_amd64 with your archetecture.
goup to copy to GOROOT, and godown to remove them (required for go install
on GOPATH).
function goup {
ls -1 $GOPATH/pkg/linux_amd64/ | xargs -I {} ln -s $GOPATH/pkg/linux_amd64/{} $GOROOT/pkg/linux_amd64/{}
ls -1 $GOPATH/src/ | xargs -I {} ln -s $GOPATH/src/{}/ $GOROOT/src/pkg/{}
}
function godown {
ls -1 $GOPATH/src/ | xargs -I {} rm --f $GOROOT/src/pkg/{}
ls -1 $GOPATH/src/ | xargs -I {} rm --f $GOROOT/pkg/linux_amd64/{}
}
Written by anil
Related protips
1 Response
other solution:
idea -> Project Structure -> SDKs -> Go SDK ... ->
Classpath and Sourcepath add $GOPATH src and pkg dir
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Intellij
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#