Skip to content

Commit 99006a8

Browse files
shawnpsdmitshur
authored andcommitted
Fix misspelling in GistCommit.CommittedAt field. (#564)
It's technically a breaking change in that anyone who was referencing the old field will now have code that won't compile, since the name changed. However, since the JSON tag was wrong too, it means that the field was never actually getting populated. So in that sense, it's not actually a break in behavior. The fixed version now matches the GitHub API and will have its value correctly populated.
1 parent f203066 commit 99006a8

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

github/gists.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ type GistCommit struct {
5959
Version *string `json:"version,omitempty"`
6060
User *User `json:"user,omitempty"`
6161
ChangeStatus *CommitStats `json:"change_status,omitempty"`
62-
CommitedAt *Timestamp `json:"commited_at,omitempty"`
62+
CommittedAt *Timestamp `json:"committed_at,omitempty"`
6363
}
6464

6565
func (gc GistCommit) String() string {

github/gists_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ func TestGistsService_ListCommits(t *testing.T) {
302302
"additions": 180,
303303
"total": 180
304304
},
305-
"commited_at": "2010-01-01T00:00:00Z"
305+
"committed_at": "2010-01-01T00:00:00Z"
306306
}
307307
]
308308
`)
@@ -314,10 +314,10 @@ func TestGistsService_ListCommits(t *testing.T) {
314314
}
315315

316316
want := []*GistCommit{{
317-
URL: String("https://api.github.com/gists/1/1"),
318-
Version: String("1"),
319-
User: &User{ID: Int(1)},
320-
CommitedAt: &Timestamp{time.Date(2010, 1, 1, 00, 00, 00, 0, time.UTC)},
317+
URL: String("https://api.github.com/gists/1/1"),
318+
Version: String("1"),
319+
User: &User{ID: Int(1)},
320+
CommittedAt: &Timestamp{time.Date(2010, 1, 1, 00, 00, 00, 0, time.UTC)},
321321
ChangeStatus: &CommitStats{
322322
Additions: Int(180),
323323
Deletions: Int(0),

github/github-accessors.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)