Gocode autocomplete not working

I want to use autocomplete but cannot get gocode ( https://github.com/nsf/gocode ).

The editor of my choice is the parentheses (using https://github.com/David5i6/Brackets-Go-IDE ). But I can not get it to work with vim + vundle or komodo.

  • GOPATH was not installed by installing GO
  • I installed GOPATH and PATH in the same way as the specified instruction, and can work fine on go projects.

My folder structure:

~/Documents/goDev/bin/ test gocode /src/ github/ jonas/ test/ test.go nfs/ gocode/ ... 

From my .profile:

 export GOPATH=/Users/jonas/Documents/goDev export PATH=$PATH:/usr/local/bin:/usr/local/go/bin/:/Users/jonas/Documents/goDev/bin 

With go env, I get:

 ... GOPATH="/Users/jonas/Documents/goDev" ... GOROOT="/usr/local/go" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" ... 

Is there something I did with my setup? Or may I have missed something else?

Thanks in advance

+7
go ide
source share
2 answers

Add the following to your .profile and log out and back:

 export GOROOT=/usr/local/go 

This gocode works for me with LiteIDE.

+2
source share

Often gocode works correctly, but the editor does not find gocode.

Check if gocode is working properly:

Terminal 1

  • close gocode
  • gocode -s -debug


Terminal 2:

  • cd "yourworkspace"
  • gocode -f = json --in = YOURGOFILE.go autocomplete 146

See the results in terminal 1.

If gocode works:

  • close gocode
  • Run the brackets, open the Go file. It should run gocode in the background.
  • Check if gocode works: "ps | grep gocode"
  • If not, check if the brackets can find the gocode executable. The var path or add the full path to the brackets configuration.
+1
source share

All Articles