Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
spec: evaluation order and initialization order specs are in contradiction #7137
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.