Open
Description
There appears to be a bug in the ./tests/fields
test/utility, causing some fields to be falsely reported as "missing".
For example, in the following test case:
{"repos/google/go-github/issues/1", &github.Issue{}},
The real GitHub API response from https://api.github.com/repos/google/go-github/issues/1 includes:
...
"site_admin": false
}
],
"milestone": null,
"comments": 2,
"created_at": "2013-05-30T18:35:59Z",
"updated_at": "2013-08-20T22:47:14Z",
...
Note that the value of milestone
is null
.
The corresponding struct field Issue.Milestone
exists:
Line 42 in d9c241b
But the output from the fields test incorrectly reports:
...
*github.Issue missing field for key: milestone (example value: <nil>)
...
I think it's because the null value gets dropped when JSON marshalling the Issue
struct, because of ,omitempty
option.