Sublime3 Plugin for integrating goimports (https://github.com/bradfitz/goimports) to your favorite editor.
-
Clone the repository to your plugins folder.
git clone https://github.com/ticcky/GoImports.git ~/.config/sublime-text-3/Packages/GoImports # for Linux
-
Specify the path to the goimports binary in
GoImports.sublime-settings
.{ "goimports_bin_path" : "/usr/local/bin/goimports" }
-
Add to your sublime keys the following command and whenever you want to run goimports hit F4. It will format/automatically adjust imports in the current go file.
{ "keys": ["f4"], "command": "go_imports" },
-
Roll ;)