:=
operator is used to initialise value and then =
operator is used assign values
var fruits := [5]string{"Apple", "Orange", "Banana", "Grape", "Plum"}
gives syntax error(syntax error: unexpected :=, expecting = go
),
where as,
var fruits = [5]string{"Apple", "Orange", "Banana", "Grape", "Plum"}
syntax works fine.
Why :=
is not allowed to initialise with var
keyword?