Recently, I got exposed to following source code from "Go Programming Blueprints" book.
type googleGeometry stuct {
*googleLocation `json:"location"`
}
type googleLocation struct {
Lat float64 `json:"lat"`
Lng float64 `json:"lng"`
}
What I don't understand is why googleGeometry structure uses pointer instead of literal, and what is the reason behind such declaration?
I would expect below declaration instead of a pointer.
type googleGeometry stuct {
gl googleLocation `json:"location"`
}