Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/gofmt: unexpected formatting of comments #22334
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
Interesting. This is actually working as intended. The problem is that the usual alignment computation breaks down when there's more then one entry per line. For comparison, see the result of this example where I made the lines all have one entry but have the same overall length: https://play.golang.org/p/4qanGJEhr1 . This time it works.
@ianlancetaylor is correct, this is working as intended, even though it's unexpected. I will leave this open for now, perhaps there's a not too difficult way to fix this.
That makes sense, I wouldn't normally do two things per line like this, but felt like it made sense for this code. Filed the bug purely because I thought the output looked like badly formatted code.
When I get a free chunk of time I'll take a look at how it does it and see whether there is an easy and sane way to make it look nicer.
Also, what about the normal code formatting as below? Currently,
What is expected,
Is this type of formatting possible with