Values and Variables
Values
Go has various value types. Here are a few basic examples.
Variables
var
declares 1 or more variables.You can declare multiple variables at once -
var
b, c
int
1, 2
Variables declared without initialization are zero-valued.
int
is 0,string
is ""
The := syntax is shorthand for declaring and initializing a variable
Last updated