douxiduan8344 2015-09-02 08:03
浏览 42
已采纳

如何在GoClipse中交叉引用?

I have installed Eclipse (Mars) with Goclipse plugin on my Macbook yesterday. They initially work perfectly. But today I found I cannot do cross reference (that means cmd+click on a keyword cannot jump the definition). And the console shows:

Running: oracle -pos=/Users/myname/coreos/naas/server/src/mycompany.com/hh/naas-server/main.go:#389,#389
-format=json describe mycompany.com/hh/naas-server
FAILED: Could not start process:    
Reason: Cannot run program "oracle": error=2, No such file or directory
  • 写回答

1条回答 默认 最新

  • drg5577 2015-09-02 09:51
    关注

    As Voker suggested, GoClipse is just an Eclipse plugin. For it to compile, build, run your Go packages and applications, it requires the Go tools.

    You can set the standard Go tool on the settings page:

    Window -> Preferences -> Go
    

    You can set some non-standard, differnet Go tools on the page:

    Window -> Preferences -> Go -> Tools
    

    This is where you can tell GoClipse where your oracle and gocode programs are located.

    You have to download oracle yourself, but the settings page above provides you a button:

    <kbd>Download Go oracle (run: `go get -u golang.org/x/tools/cmd/oracle`)</kbd>

    So you have to go get it either manually or by the above-mentioned button. Install it using go install, so you will have the executable binary oracle. You have to set the full path of oracle on the Go -> Tools settings page, and it will work.

    While we're at it: I also recommend you to install gocode (https://github.com/nsf/gocode) which will provide you the auto-complete feature (<kbd>CTRL+SPACE</kbd> or <kbd>CMD+SPACE</kbd> for a list of exported identifiers in package, list of methods etc.). Just also use the button on the same settings page:

    <kbd>Download gocode (run: `go get -u github.com/nsf/gocode`)</kbd>

    Install it and set the full path of the resulted executable binary gocode.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大