GO explicit array initialization
问题 Is there explicit array initialization (declaration and assignment) in GO or the only way is using the shorthand operator? Here is a practical example - is this two equal: a := [3]int{1, 0, 1} var a [3]int = [3]int{1, 0, 1} 回答1: They are equivalent. In general: Spec: Short variable declaration: A short variable declaration uses the syntax: ShortVarDecl = IdentifierList ":=" ExpressionList . It is shorthand for a regular variable declaration with initializer expressions but no types: "var"