{"comment":{"url":"https://api.github.com/repos/voutasaurus/passgen/comments/13943153","html_url":"https://github.com/voutasaurus/passgen/commit/abb2158b688a19307acb6bc5ab40af215c383718#commitcomment-13943153","id":13943153,"user":{"login":"shurcooL","id":1924134,"avatar_url":"https://avatars.githubusercontent.com/u/1924134?v=3","gravatar_id":"","url":"https://api.github.com/users/shurcooL","html_url":"https://github.com/shurcooL","followers_url":"https://api.github.com/users/shurcooL/followers","following_url":"https://api.github.com/users/shurcooL/following{/other_user}","gists_url":"https://api.github.com/users/shurcooL/gists{/gist_id}","starred_url":"https://api.github.com/users/shurcooL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shurcooL/subscriptions","organizations_url":"https://api.github.com/users/shurcooL/orgs","repos_url":"https://api.github.com/users/shurcooL/repos","events_url":"https://api.github.com/users/shurcooL/events{/privacy}","received_events_url":"https://api.github.com/users/shurcooL/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":"","commit_id":"abb2158b688a19307acb6bc5ab40af215c383718","created_at":"2015-10-23T04:21:04Z","updated_at":"2015-10-23T04:21:04Z","body":"Sure thing!\r\n\r\nMy approach, which I highly recommend, is a gofmt-on-save hook. Every time I save any .go file in my editor, it runs it through `gofmt` when writing it to disk. That way, I get the benefits of being able to fix up indentation by pressing Cmd+S instead of having to do it manually, and all my .go files are always `gofmt`ed on disk.\r\n\r\nActually, I am using [`goimports`](https://godoc.org/golang.org/x/tools/cmd/goimports) instead of `gofmt`, which fixes imports in addition to doing what `gofmt` does (there's no reason to run both, `goimports` is a superset of `gofmt`). I find that invaluable as it saves a lot of time.\r\n\r\nAll major editors have plugins to have an gofmt-on-save hook for Go. I use Sublime Text, and a GoSublime plugin."}}