sqs / goreturns

A gofmt/goimports-like tool for Go programmers that fills in Go return statements with zero values to match the func return types
Other
530 stars 55 forks source link

Struct and bson tags alignment issues #39

Closed carlca closed 6 years ago

carlca commented 6 years ago

I don't know if I should be addressing this issue to you or @bradfitz or someone else. Anyhow:

When I save my go code, my structs are being aligned like this: screen shot 2017-11-24 at 15 18 20

I would prefer the automatic alignment of the string bson info to carry on over the comments, like so: screen shot 2017-11-24 at 15 23 04

Is there any way of achieving this with goreturns, goimports or gofmt? Thanks!

sqs commented 6 years ago

This would be a decision for gofmt. However, it’s unlikely they would change it or make it configurable since it would result in a lot of unexpected diffs.

carlca commented 6 years ago

I take your point. After all, this is a tool that is intended to cut down the variation in formatting, not result in a lot of unexpected diffs!