Golang自动完成nsf软件包

I have installed sublime and go.

Tried the autocompletion feature offered by https://github.com/nsf/gocode.

It works perfectly for standard packages.

But not working for external packages like the ones fetched from github.

Any help on this appreciated. Thanks.

It will only work if you build and install those external packages.

if you just go get their sources, the completion won't work, even said sources are in the GOPATH/src/....

Those packages need to be at least compiled (GOPATH/pkg).

As mentioned in "How does Go update third-party packages?", a go get -u all can help.

For go autocomplete to work (Atom Editor, Sublime, even vim with autocomplete)

  1. Your package must be placed in the go path. (this can be automatically done if the project is on github and you use the get tool)

     go get -u github.com/username/packageName
    
  2. you must build your package

     go build $GOPATH/pathToYourProject...
    
  3. you must install your package

     go install $GOPATH/pathToYourProject...