I'm a noob at GO, Just starting to learn the language. why is this fine:
const name, age = "Kim", 22
but this is not
const name, age := "Kim", 22
I'm a noob at GO, Just starting to learn the language. why is this fine:
const name, age = "Kim", 22
but this is not
const name, age := "Kim", 22
From A Tour of Go:
Constants cannot be declared using the
:=
syntax.
:=
is used to declare a variable inferring its type from the value. Though, declaring and initializing a variable is not the same as declaring a constant. See also here and here.