make Function in Go
Looks like some new Gophers are confused about the difference between var and make(). First of all, let’s talk about Go’s approach to types and values. Go doesn’t have a null value like some other languages. This means a variable will always have some value, even when you define it without an assignment. Well, how does Go handle these defined variables, you ask? Simple, Go assigns the “zero value” of that type to the variable. For example, when you write var x int, even if you don’t assign anything, the value of x will be 0. ...