Fixes error where the "owned" attribute should be capitalized to
indicate it is public.
This commit is contained in:
parent
e3e6c2d0c4
commit
6b1ec66ef3
9
main.go
9
main.go
@ -101,7 +101,7 @@ func openBrowser(url string) {
|
||||
}
|
||||
|
||||
type GameList struct {
|
||||
owned []int64 `json:"owned"`
|
||||
Owned []int `json:"owned"`
|
||||
}
|
||||
|
||||
func getGameList() *GameList {
|
||||
@ -109,14 +109,15 @@ func getGameList() *GameList {
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to get game list: %v", err)
|
||||
}
|
||||
defer res.Body.Close()
|
||||
body, err := ioutil.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to parse game body: %v", err)
|
||||
}
|
||||
|
||||
log.Println(string(body))
|
||||
// log.Println(string(body))
|
||||
var gl = new(GameList)
|
||||
err = json.Unmarshal(body, &gl)
|
||||
err = json.Unmarshal(body, gl)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to parse game list response: %v", err)
|
||||
}
|
||||
@ -171,6 +172,6 @@ func main() {
|
||||
}
|
||||
|
||||
gl := getGameList()
|
||||
log.Println(gl.owned)
|
||||
log.Println(gl.Owned)
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user