You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The struct literal syntax isn't actually explained in the tutorial text. The "Vertex{1, 2}" kind of comes out of nowhere. Some text like this would be helpful:
Struct literals are the name of the struct with values in braces, in the order they are defined in the struct. In this example, Vertex{1, 2} creates a Vertex with x=1 and y=2.
The text was updated successfully, but these errors were encountered:
Existing description does not give a clear idea about the syntax of struct literals.
New changes added small description and example breakdown to explain struct literals.
Fixes: golang/tour#412
Context: https://tour.golang.org/moretypes/5
The struct literal syntax isn't actually explained in the tutorial text. The "Vertex{1, 2}" kind of comes out of nowhere. Some text like this would be helpful:
The text was updated successfully, but these errors were encountered: