Need help with getting values

i am not able to fetch values

This code example retrieves your data:
Do you have any questions about it?

The JSON you unmarshal does not map to your struct

type Person struct {
                 key  string
                 value  string

See @CurtGreens playground.

But you can define the JSON struct also in one type by just using nested struct definitions . Example:

type GoogleLocationResponse struct {
	Results []struct {
		Geometry struct {
			Location struct {
				Lattitude float32 `json:"lat"`
				Logitude  float32 `json:"lng"`
			} `json:"location"`
		} `json:"geometry"`
	} `json:"results"`
	Status string `json:"status"`

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.