Skip to content

Instantly share code, notes, and snippets.

@robertotambunan
Created June 13, 2020 08:26
Show Gist options
  • Save robertotambunan/6d9f7138a7c1c4db41ac371c6f3682b3 to your computer and use it in GitHub Desktop.
Save robertotambunan/6d9f7138a7c1c4db41ac371c6f3682b3 to your computer and use it in GitHub Desktop.
result := make([]AttributeNationData, 0)
if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
log.Println("NewDecoder", err)
}
type(
NationData struct {
CountryRegion string `json:"Country_Region"`
Confirmed int `json:"Confirmed"`
Deaths int `json:"Deaths"`
Recovered int `json:"Recovered"`
LastUpdate int64 `json:"Last_Update"`
LastUpdateStr string
}
AttributeNationData struct {
Attribute NationData `json:"attributes"`
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment