goclipse eclipse go 开发环境搭建+跳转支持


Eclipse Mars (4.5) 下载地址:https://www.eclipse.org/mars/
golang 1.6.0rc2 下载地址:http://www.golangtc.com/download
goclipse 0.14.1 下载地址: https://github.com/GoClipse/goclipse
eclipse在线安装地址:http://goclipse.github.io/releases/
eclipse+goclipse安装后不能联想和跳转问题解决
Window->Preferences->Go
指定$GOPATH 和$GOROOT



go get -u -v github.com/nsf/gocode



go install -u -v github.com/nsf/gocode



go get -v github.com/rogpeppe/godef



go install -v github.com/rogpeppe/godef



go get -u -v golang.org/x/tools/cmd/guru



go install -u -v golang.org/x/tools/cmd/guru





go install 之后会在 $GOPATH/bin/ 中出现各种工具文件
gocode 提供代码补全
godef 代码跳转
gofmt 自动代码整理
golint 代码语法检查
goimports 自动整理imports
oracle 代码callgraph查询(plugin中还在todolist中,但是不配置一直报错。实在烦。)
最后不要忘记复制上面的命令到 $GOROOT/bin/下面



$go get github.com/9fans/go
can’t load package: package github.com/9fans/go: no Go files in /Users/didi/PhpstormProjects/ProjGit/src/go.intra.xiaojukeji.com/gulfstream/price-api/src/github.com/9fans/go



$go get -u -v github.com/9fans/go/…
github.com/9fans/go (download)



Right now 9fans.net is down issue3 which is why godef is not being able to build.



For the github repo you might want to do:
go get -u -v github.com/9fans/go/…



Then just move 9fans out of github.com/ into 9fans.net and re-try the godef install it should work without issue.
ex:
mv $GOPATH/src/github.com/9fans $GOPATH/src/9fans.net



cp -r src/github.com/9fans/go/* src/github.com/rogpeppe/godef/vendor/9fans.net/go/



$go build src/github.com/rogpeppe/godef/godef.go



至此可以完美支持跳转


Category web