Colon equals in Golang

:= is for both declaration, and assignment, whereas = is for assignment only.
For example, var abc int = 20 is the same as abc := 20

Inside a function, the := short assignment statement can be used in place of a var declaration with implicit type.
Outside a function, every statement begins with a keyword (var, func, and so on) and so the := construct is not available.