ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Gofmt

by noonat ST3

Sublime plugin to run gofmt (or goimports, or whatever you want).

Labels go

Details

Installs

  • Total 5K
  • Win 1K
  • OS X 3K
  • Linux 1K
Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6
Windows 1 1 5 3 0 2 3 7 6 5 6 6 7 3 3 4 2 3 1 2 0 9 4 9 0 2 2 2 4 2 3 1 4 2 2 2 2 5 0 0 0 11 3 10 6 0
OS X 6 7 5 9 5 7 11 3 11 10 10 6 9 2 6 11 8 3 8 8 7 7 13 10 9 6 8 12 17 13 11 7 5 8 5 8 5 11 1 0 0 12 8 14 10 4
Linux 0 10 6 10 3 1 2 8 8 1 7 4 6 2 1 0 4 4 1 2 10 8 6 4 6 3 1 0 4 2 5 4 11 3 2 12 3 3 3 0 0 6 3 6 5 2

Readme

Source
raw.​githubusercontent.​com

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.