golang struct instance code example
Example 1: go create new instance of struct
type Person struct {
Name string
}
func main() {
var me Person
me.name = "mattalui"
}
Example 2: init struct go
type Student struct {
Name string
Age int
}
var a Student // a == Student{"", 0}
a.Name = "Alice" // a == Student{"Alice", 0}