(r io.Reader)
| 66 | } |
| 67 | |
| 68 | func parseResponse(r io.Reader) (string, int, error) { |
| 69 | var reply struct { |
| 70 | Name string |
| 71 | NumRepos int `json:"public_repos"` |
| 72 | } |
| 73 | dec := json.NewDecoder(r) |
| 74 | if err := dec.Decode(&reply); err != nil { |
| 75 | return "", 0, err |
| 76 | } |
| 77 | |
| 78 | return reply.Name, reply.NumRepos, nil |
| 79 | } |
| 80 | |
| 81 | /* JSON <-> Go |
| 82 |