I am trying to write a for loop in Go with multiple variables.
Coming from the javascript world, I'd like to achieve something like this:
var i = 10;
var b = 2;
for (var a = b; i; i /= 2, b *= b ) {
// some code
}
I've tried a 'raw translation' like this:
i, b := 10, 2
for a := b; i; i /= 2, b *= b {
// some code
}
But it doesn't work. What is the proper syntax?
Many thanks!
idefined in your Javascript code?