An add on to the GoSublime package, when installed it updates the autocomplete for external source files you may be working on in your path.
Sublime Text 3 only.
Note on the below:
GOPATH - This is the GOPATH for your project. No trailing slashes.
ROOT - The root is where your main binary you're building is compiled from.
GOBIN - Bin directory containing go binary
An example structure is
YourProject
Download the python script
Copy it into the Packages directory, Sublime Text -> Preferences -> Browse Packages -> GoSublime
Setup a Project with the following in:
{ "env": { "GOPATH": "/Users/YOURUSER/Documents/Projects/YourProject", "ROOT" : "src/MainProject", "GOBIN": "/usr/local/go/bin" }, "folders": [ ...sublimey stuff ], }
Setup new key binding Sublime Text -> Preferences -> Keybindings - Users
[ { "keys": ["super+s"], "command": "save_and_go_install" }, ]