https://github.com/noonat/sublime-gofmt
Sublime plugin to run gofmt (or goimports, or whatever you want).
https://github.com/noonat/sublime-gofmt
gofmt goimports golang sublime-text sublime-text-3
Last synced: 4 days ago
JSON representation
Sublime plugin to run gofmt (or goimports, or whatever you want).
- Host: GitHub
- URL: https://github.com/noonat/sublime-gofmt
- Owner: noonat
- License: mit
- Created: 2017-02-26T08:55:42.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-11-09T19:13:43.000Z (over 5 years ago)
- Last Synced: 2024-10-19T11:30:35.337Z (6 months ago)
- Topics: gofmt, goimports, golang, sublime-text, sublime-text-3
- Language: Python
- Size: 15.6 KB
- Stars: 28
- Watchers: 5
- Forks: 6
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:```json
{
"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.[goimports]: https://godoc.org/golang.org/x/tools/cmd/goimports