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
http://tip.golang.org/ref/spec#Order_of_evaluation says that function calls (etc) are
evaluated in left-to-write order in assignments.
http://tip.golang.org/ref/spec#Program_execution says that top-level variables are
initialized in the order of their dependencies.
Here's an example where these rules contradict each other:
http://play.golang.org/p/Tg-9f8zlNy
By the section on evaluation order, f should be called before g, but by the section on
initialization order, g must be called before f, and that is what's happening.
The section on evaluation order needs to be amended.
The text was updated successfully, but these errors were encountered:
r suggests that we should make this case invalid - i.e., if the initialization order and
the evaluation order disagree, the program is rejected. This might also catch unexpected
errors.
The text was updated successfully, but these errors were encountered: