Check out example codes for "golang initialize nested struct". It will help you in understanding the concepts better.
Code Example 1
type Configuration struct {
Val string
Proxy Proxy
}
type Proxy struct {
Address string
Port string
}
func main() {
c := &Configuration{
Val: "test",
Proxy: Proxy{
Address: "addr",
Port: "port",
},
}
fmt.Println(c)
fmt.Println(c.Proxy.Address)
}
Learn ReactJs, React Native from akashmittal.com