Skip to content

Upgrade RepoStatus.ID from int to int64 #807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,10 @@ func Bool(v bool) *bool { return &v }
// to store v and returns a pointer to it.
func Int(v int) *int { return &v }

// Int64 is a helper routine that allocates a new int64 value
// to store v and returns a pointer to it.
func Int64(v int64) *int64 { return &v }

// String is a helper routine that allocates a new string value
// to store v and returns a pointer to it.
func String(v string) *string { return &v }
2 changes: 1 addition & 1 deletion github/repos_statuses.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

// RepoStatus represents the status of a repository at a particular reference.
type RepoStatus struct {
ID *int `json:"id,omitempty"`
ID *int64 `json:"id,omitempty"`
URL *string `json:"url,omitempty"`

// State is the current state of the repository. Possible values are:
Expand Down
6 changes: 3 additions & 3 deletions github/repos_statuses_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestRepositoriesService_ListStatuses(t *testing.T) {
t.Errorf("Repositories.ListStatuses returned error: %v", err)
}

want := []*RepoStatus{{ID: Int(1)}}
want := []*RepoStatus{{ID: Int64(1)}}
if !reflect.DeepEqual(statuses, want) {
t.Errorf("Repositories.ListStatuses returned %+v, want %+v", statuses, want)
}
Expand Down Expand Up @@ -66,7 +66,7 @@ func TestRepositoriesService_CreateStatus(t *testing.T) {
t.Errorf("Repositories.CreateStatus returned error: %v", err)
}

want := &RepoStatus{ID: Int(1)}
want := &RepoStatus{ID: Int64(1)}
if !reflect.DeepEqual(status, want) {
t.Errorf("Repositories.CreateStatus returned %+v, want %+v", status, want)
}
Expand Down Expand Up @@ -96,7 +96,7 @@ func TestRepositoriesService_GetCombinedStatus(t *testing.T) {
t.Errorf("Repositories.GetCombinedStatus returned error: %v", err)
}

want := &CombinedStatus{State: String("success"), Statuses: []RepoStatus{{ID: Int(1)}}}
want := &CombinedStatus{State: String("success"), Statuses: []RepoStatus{{ID: Int64(1)}}}
if !reflect.DeepEqual(status, want) {
t.Errorf("Repositories.GetCombinedStatus returned %+v, want %+v", status, want)
}
Expand Down
2 changes: 1 addition & 1 deletion github/strings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func TestString(t *testing.T) {
{PushEvent{PushID: Int(1)}, `github.PushEvent{PushID:1}`},
{Reference{Ref: String("r")}, `github.Reference{Ref:"r"}`},
{ReleaseAsset{ID: Int(1)}, `github.ReleaseAsset{ID:1}`},
{RepoStatus{ID: Int(1)}, `github.RepoStatus{ID:1}`},
{RepoStatus{ID: Int64(1)}, `github.RepoStatus{ID:1}`},
{RepositoryComment{ID: Int(1)}, `github.RepositoryComment{ID:1}`},
{RepositoryCommit{SHA: String("s")}, `github.RepositoryCommit{SHA:"s"}`},
{RepositoryContent{Name: String("n")}, `github.RepositoryContent{Name:"n"}`},
Expand Down