问题描述
我试图在Linux 32位上使用LiteIDE(Go IDE)。除了自动完成之外,一切都可以使用构建,运行,一切正常。 gocode
二进制文件似乎正在运行:
ithisa @ miyasa〜 > ps aux | grep gocode
ithisa 10003 0.0 0.0 823788 2624 pts / 1 Sl + 09:06 0:00 / home / ithisa / scratch / liteide / bin / gocode -s -sock unix -addr localhost:37373
我可能会做错什么?
将开始 GOROOT =
的行更改为指向您的'go'目录。如果您从golang.org安装它,并且如果您不知道它在哪里,普通旧$ HOME / go是常用设置,则运行 go env
将显示 GOROOT
Go工具链本身正在使用。当然,如果该行被注释掉( #GOROOT =
...),请删除#
。保存。
如果工具栏完全丢失,则视图 - >环境工具栏将取消隐藏它。
值得在 .bashrc
中设置GOROOT和相关设置,所以从命令行开始的工具看到它。我在我的homedir中安装了Go和LiteIDE,并且我的工作区是〜/ gocode
,所以我的是:
<$ p $ export PATH =$ HOME / go / bin:$ HOME / liteide / bin:$ PATH
export GOROOT = $ HOME / go
export GOPATH = $ HOME / gocode
我无法确定这是否是您的问题,但如果我将GOROOT解除了症状匹配你所看到的:完成适用于我的代码,但不适用于标准库。祝你好运!
I'm trying to use LiteIDE (the Go IDE) on Linux 32-bit. Everything works except for autocomplete. Builds, running, everything works. The gocode
binary seems to be running tho:
ithisa@miyasa ~> ps aux | grep gocode
ithisa 10003 0.0 0.0 823788 2624 pts/1 Sl+ 09:06 0:00 /home/ithisa/scratch/liteide/bin/gocode -s -sock unix -addr localhost:37373
What might I be doing wrong?
You may need to set a GOROOT=. To set it within LiteIDE, look for the environment toolbar; it should be a a dropdown, probably with "system" preselected, and a button. Click the button to bring up the Edit Environment pane, then double-click "system.env", or whichever environment was picked in the dropdown.
Change the line that starts GOROOT=
to point to your 'go' directory. Plain old $HOME/go is a common setting if you installed it from golang.org, and if you don't know where it is, running go env
will show the GOROOT
that the Go toolchain itself is using. And of course if the line is commented out (#GOROOT=
...) remove the #
. Save.
If the toolbar is missing entirely, View -> Environment toolbar unhides it.
It's probably also worth setting GOROOT and related settings in your .bashrc
, so tools started from the command line see it. I installed Go and LiteIDE in my homedir and my workspace is ~/gocode
, so mine is like:
export PATH="$HOME/go/bin:$HOME/liteide/bin:$PATH"
export GOROOT=$HOME/go
export GOPATH=$HOME/gocode
I can't be certain this is actually your issue, but if I unset my GOROOT the symptom matches what you're seeing: completion works on my code, but not on the standard library. Good luck!
这篇关于LiteIDE没有自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!