Sublime plugin to run gofmt (or goimports, or whatever you want).
Switch branches/tags
Nothing to show
Clone or download
Latest commit 8d3cfc2 Sep 6, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Initial commit Feb 26, 2017
CHANGELOG.md Update changelog Sep 6, 2018
Default.sublime-commands Initial commit Feb 26, 2017
Gofmt.sublime-settings Initial commit Feb 26, 2017
LICENSE Initial commit Feb 26, 2017
Main.sublime-menu Remove trailing commas Sep 29, 2017
README.md Initial commit Feb 26, 2017
dependencies.json Add missing shellenv dependency Sep 29, 2017
gofmt.py corrected how cwd is passed to the subprocess Aug 27, 2018

README.md

Sublime Gofmt

This Sublime Text 3 package adds support for running gofmt on your Go source files. It runs on save by default, but that can be disabled. You can run it manually via a palette command (Gofmt: Format this file).

If gofmt encounters errors, the plugin will mark the lines and highlight those errors in your source file.

Goimports

If you want to use goimports instead, open to Sublime Text -> Preferences -> Package Settings -> Gofmt -> Settings - User and enter a config like this:

{
  "cmds": [
    ["goimports", "-e"]
  ]
}

Note that cmds is an array, so you can put multiple commands in there, if you want to run the file through more than one formatter for some reason.