3. Variables in Go — A Book of Go
2 min readMay 14, 2024
Now, let’s talk about variables.
Variables can be declared with the keyword var
:
- Can be a list of variables: `var a, b, c int
- Can be used within functions (used at package or function level)
- A
var
declaration can have an initialisation:var i int = 1