@calmh but this student variable is a struct type not a primitive type variable like int or string.
then how is it getting initialize implicitly to zero?
So, we don’t have to initialize the empty struct ever in go?
As the linked spec says, the initialization is recursive. All members of the struct get the zero value for their type. You do not need to explicitly initialize a struct to anything.
In fact, it is considered best practice to make the zero value of the struct useful and workable without any initialization. Take for example a bytes.Buffer: