Golang Variables And Inferred Typing
In Golang the var
statement declared a list of variables with the type declared last.
Or even
Variables can also be declared one by one
A var declaration can include initializers, one per variable
If an initializer is present the type can be omitted, the variable will take the type of the initializer (inferred typing)
You can also initialize variables on the same line:
Inside a function, the :=
short assignment statement can be used in place of var declaration with implicit type