Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
proposal: Go 2: add a "scope lifting" operator ^ for short variable declarations in if and for statements #40349
Edit2: Well the first line of the example would not work because a can not be a new variable but you get my point.
@D1CED thanks for the example. According to language specification no expressions are allowed currently allowed on the left hand side of a short variable declaration:
So I don't really understand the example. Both lines do not seem to be valid go?