My question was, since goimports modifies your document (and gofmt even more so), is your undo stack preserved across saves? If so, how?
I use Sublime Text 3 with GoSublime and have noticed that the undo stack is just my changes (makes sense, the goimports is an external process), but that's cool because any CTRL+S is going to trigger goimports and so the correction of the imports is invisible and always there.