-
Notifications
You must be signed in to change notification settings - Fork 520
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
Map literals code change unclear #1449
Comments
crisman
added a commit
to crisman/golang_website
that referenced
this issue
Feb 23, 2023
Between 'map-literals.go' and 'map-literals-continued.go' there are four changes (omit element type, single line the block, add space to align the "Google" element, and remove the terminal comma in the block) which makes it hard for reader a to understand what it is "you can omit" in the 'Map literals continued' section of 'moretypes.article'. To avoid the three text changes that the article does not talk about, update the before code in 'map-literals.go' to already be formatted on a single line per map entry. Also add code examples in the article explaining the two versions and why the literal element type may be elided. Fixes golang/tour#1449
crisman
added a commit
to crisman/golang_website
that referenced
this issue
Feb 23, 2023
Between 'map-literals.go' and 'map-literals-continued.go' there are four changes (omit element type, single line the block, add space to align the "Google" element, and remove the terminal comma in the block) which makes it hard for a reader to understand what it is "you can omit" in the 'Map literals continued' section of 'moretypes.article'. To avoid the three text changes that the article does not talk about, update the before code in 'map-literals.go' to already be formatted on a single line per map entry. Add code examples in the article explaining the two versions and why the literal element type may be elided. Fixes golang/tour#1449
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Between the code examples in "Map literals" and "Map literals continued"
https://go.dev/tour/moretypes/20
https://go.dev/tour/moretypes/21
it is less clear what changes between the code in 20 & 21 (the type name we can omit) the style is from:
to
making three changes (single line the block, adding space for value alignment, and removing the type)
makes it harder to understand what the article is pointing out.
The text was updated successfully, but these errors were encountered: