Emacs launched from Spotlight cannot get correct environment variables, thus gocode could not get GO pkg path.
To solve this, follow steps here:
1. Use ‘launched’ to set environment variables:
PATH as: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin:/usr/local/go/bin
GOROOT as: /usr/local/go
2. After environment variables set, any application launched from Term can receive right PATH, GOBIN and GOROOT.
So next launch Emacs from Terminal.App to test:
3. Create an alias in ~/.bash_profile like: alias startemacs=’/Applications/Emacs.app/Contents/MacOS/Emacs&’