Actually, the following is valid syntax in Go 1.0 and later:
var i = 0
The use of "var" without a type is a common idiom when binding global variables, such as: var ErrTooLarge = errors.New("bytes.Buffer: too large")
Oddly, the := shortcut is not legal in the global context. Also fun: var (
i = 0
j = 0
)
So, going back to the original comment -- yes, Go has some odd little shortcuts and inconsistencies.