Skip to content

Glossary: Go Basics

:= (short variable declaration)

Also written: :=, declare and assign

Creates a new variable and gives it a value, with Go working out the type from that value. Use plain `=` to change a variable that already exists.

Where the book teaches it

Related terms

var