Here is sample code:
package main
import (
"fmt"
)
type A struct {
Name string
}
func (this *A) demo(tag string) {
fmt.Printf("%#v\n", this)
fmt.Println(tag)
}
func main() {
var ele A
ele.demo("ele are called")
ele2 := A{}
ele2.demo("ele2 are called")
}
Run results:
&main.A{Name:""}
ele are called
&main.A{Name:""}
ele2 are called
It looks like those are the same about var ele A and ele2 := A{}
So, the struct's Zero value is not nil, but a struct that all of the property are initialized Zero value. Is the guess right?
If the guess is right, then the nature of var ele A and ele2 := A{} are the same right?