-
Notifications
You must be signed in to change notification settings - Fork 18k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/gofmt: aligns type spec alias = with type spec non-alias rhs expressions #24302
Comments
Sorry, gofmt is not soliciting change requests on its format at this time. Gofmt made a set of choices at one point, and everybody agrees to live with them, even if everybody might take issue with different individual choices. (as Rob says: https://www.youtube.com/watch?v=PAAkCSZUG1c&t=8m43s) For Go 2, @griesemer may trawl through the issue tracker for all old gofmt style request bugs. |
Yes, but that was many years before type aliases existed :) |
That’s true but the formatting follows what var groupings does:
So it’s consistent. Changing one (type grouping) would arguably warrant changing the other (var groupings), which we aren’t planning to do. |
This reads like you're referring to a years-old policy, so please correct me if that's wrong, but the 1.10 release contradicts this position. Not only did it change the gofmt format:
but the release notes go on to say that gofmt changes are to be expected from time to time:
And then discuss the ramifications:
Was there a policy change after 1.10 shipped that I missed?
Ah, good point! Seems clear it's intentional, then. Makes sense to me to keep this closed. |
I should have worded it a bit differently. If a change is small, then the proper mechanism would be to propose a change to gofmt via the proposal process. But as this would carry over into other aspects separate from type aliases, I feel it’s too large a change to do at the moment for the reasons stated above. As noted, @griesemer may look through old gofmt bugs for Go 2. When things get started in earnest I encourage you to re-open the issue. It’s just too early at this point. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
https://play.golang.org/p/CdoegZ_hPY3
What did you expect to see?
What did you see instead?
I can see the argument for doing it the current way, in that it might seem at a glance (incorrectly) that all types were aliases if done the other way. Maybe. But to my eyes it also just...looks a little weird. I searched the issues and didn't see anything open or closed related to this, so I thought I would bring this up just in case it's a mistake. Sorry if it's not.
The text was updated successfully, but these errors were encountered: