3 ms·
Sure; I was just saying, the parent comment asked for an example of inconsistency there it is. Either allow the use of var to declare a variable, or dont. Don
by shadowmint 14y ago
Sure; I was just saying, the parent comment asked for an example of inconsistency there it is.
Either allow the use of var to declare a variable, or dont.
Dont mix and match in different contexts; this clearly violates the go goal of consistent syntax.
Edit, incidentally the use of var is perfectly legal like this:
package main
import "fmt"
func main() {
var a = 10
b := 10
fmt.Printf("%d %d\n", a, b);
for i := 0; i < 10; i++ {
fmt.Printf("%d Value\n", i)
}
}