What is the difference between the = and := operators, and what are the use cases for them? They both seem to be for an assignment?
=
:=
“:=” use to do declaration and initilization at the same time, following is an example.
Usage of “=”
var i int
i = 10
https://play.golang.org/p/RU88ty_SGa
Usage of “:=”
i := 10
https://play.golang.org/p/XBdjBh-DQB