A lot of languages do have auto formatters with opinionated defaults for this.
For go, gofmt is so opinionated that you can't even configure it, which is kinda cool because it means all go code that uses it will look the same.
There's also rustfmt for rust and prettier for JS/TS (and I assume similar for lots of other languages I'm not familiar with), both of which are configurable, which I prefer - but I can see the upsides of a one-size-fits-all code formatting tool (especially for a language like go where a reasonably constrained feature set/syntax is an explicit goal of the language).