Is it possible run govet fieldalignment on save?
Answered
Correct struct field alignment is a known method of memory optimizations' in Go. Is there a way to run govet fieldalignment on save to highlight recommended ordering? From the IDE , the Tools → Actions on Save windows would be one possible point to allow this however it doesn't appear to allow custom actions. Is there another way this could be achieved?
Please sign in to leave a comment.
Hi,
You can create a custom file watcher via Settings | Tools | File Watchers and then enable it in Actions on Save.
However, it will show suggestions in Console tool window instead of in the editor.
Feel free to follow GO-2093 for native support of memory alignments.