Created
June 13, 2020 08:26
-
-
Save robertotambunan/6d9f7138a7c1c4db41ac371c6f3682b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
result := make([]AttributeNationData, 0) | |
if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { | |
log.Println("NewDecoder", err) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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