How to get autocomplete in GoClipse


I installed the Go compiler and set the GOROOT and GOPATH environment variables correctly. To work with Go files, I installed the GoClipse plugin in Eclipse. When I tried to make Goclipse autocomplete my code, I got this error:

Cannot run program "gocode": error=2, No such file or directory


The Go compiler is not typically used for autocompletion. There is a separate gocode tool that is used for this purpose. So, to get autocompletion we need to install this by using this command:

$ go get -u

I found that this installed the gocode binary in $GOPATH/bin. I opened Window -> Preferences -> Go -> Tools and set this path for gocode. Autocompletion started working immediately after this!🙂

Tried with: GoClipse 0.14.1, Eclipse 4.5.2 and Go 1.6.2

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s