Struct alignment




Coming from VSCode + Golang plugin, I found something weird about the structs.


In this editor, the struct are aligned vertically on save (Like in the attached picture), but in Goland this does not happen.


I thought this might be a config so I went into the settings but it looks like the code style config is nowhere near as complete as in other Jetbrains tool. If I'm not mistaken this is required by golint.


Is there any way to setup Goland so that it automatically aligns everything instead of doing it by hand?

1 comment

Hello Nathan,

In our IDEs, file saving occurs automatically in many cases (when you lose focus, when you start the configuration, and so on). That is why formatting is disabled by default and needs to be invoked (Code | Reformate Code).

Also, when committing a file, I recommend turning on the Go Fmt option for formatting.


Please sign in to leave a comment.