I have several functions that take uint as their input:
func foo(arg uint) {...} func bar(arg uint) {...} func baz(arg uint) {...}
I have a loop whose limits are equal to uint constants of value
const ( Low = 10 High = 20 )
In the next cycle, how can I say that I want to be uint ? The compiler complains that it is an int .
for i := Low; i <= High; i++ { foo(i) bar(i) baz(i) }
I really don't want to call uint(i) for every function call, and the following is correct, but it makes me feel dirty:
var i uint for i = Low; i <= High; i++ { foo(i) bar(i) baz(i) }
source share