-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: Anonymous field could be placed in the 2nd column of a struct #17002
Comments
I suspect it's being placed in the first column because while it's called an anonymous field, it's actually named rune (as well as being type rune). |
I'm going to re-open this. I think the suggestion is quite reasonable and syntactically it makes sense (but @quentinmit has a point, too). Not saying that I will do anything about it yet, but I want to think about this a bit. |
Oh, cool. Thanks. There's a whole variety of ways to look at it, so I can understand opinion on where such a thing should go is going to differ for each person. I see the columns as 'name' and 'type', and so it makes logical sense to me that a name-less field should be lined up that way. The other side of the coin is that a nameless type uses the type as the name; ergo -- it's a name and belongs in the first column. Last but not least, you can write the type twice as a workaround: type thing {
rune rune // a character
`` |
@Kroc This is not field with a nameless type, it's a field w/o an explicit field name. That is, |
Excuse my ignorance, I'm extremely new to Go still :S |
What version of Go are you using (
go version
)?go version go1.7 windows/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: