DisposaBoy/GoSublime — Issue #14: Is anyone else missing run_gofmt_on_save?
Author: tux21b
Created: 2011-10-09 14:58:40+00:00
State: open

I've always enjoyed the gofmt_on_save functionality, but now it's gone. I am quite sloppy so I keep forgetting to run gofmt before saving the files on my own and I really don't like the idea of adding and remembering an additional key binding.

The Usage.md now reveals that there might be some rare cases which might corrupt the file. However, I've (luckily?) never encountered such a case and in my opinion it's save enough to trust gofmt (as long as it doesn't return any error). Also, if I do not like the change, there is still an undo command or even git reset (in the worst possible case).

So, what's about adding an additional "save" argument to the gs_fmt command which is false by default? It can be used to tell gs_fmt to save the file afterwards, so that it can be used as drop-in replacement for C-s. You can still leave the disclaimer in place.