diff --git a/github/pulls.go b/github/pulls.go index 3548852..199b0a8 100644 --- a/github/pulls.go +++ b/github/pulls.go @@ -148,7 +148,7 @@ func (s *PullRequestsService) Edit(owner string, repo string, number int, pull * // ListCommits lists the commits in a pull request. // // GitHub API docs: https://developer.github.com/v3/pulls/#list-commits-on-a-pull-request -func (s *PullRequestsService) ListCommits(owner string, repo string, number int, opt *ListOptions) (*[]Commit, *Response, error) { +func (s *PullRequestsService) ListCommits(owner string, repo string, number int, opt *ListOptions) ([]Commit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/commits", owner, repo, number) u, err := addOptions(u, opt) if err != nil { @@ -166,13 +166,13 @@ func (s *PullRequestsService) ListCommits(owner string, repo string, number int, return nil, resp, err } - return commits, resp, err + return *commits, resp, err } // ListFiles lists the files in a pull request. // // GitHub API docs: https://developer.github.com/v3/pulls/#list-pull-requests-files -func (s *PullRequestsService) ListFiles(owner string, repo string, number int, opt *ListOptions) (*[]CommitFile, *Response, error) { +func (s *PullRequestsService) ListFiles(owner string, repo string, number int, opt *ListOptions) ([]CommitFile, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/files", owner, repo, number) u, err := addOptions(u, opt) if err != nil { @@ -190,7 +190,7 @@ func (s *PullRequestsService) ListFiles(owner string, repo string, number int, o return nil, resp, err } - return commitFiles, resp, err + return *commitFiles, resp, err } // IsMerged checks if a pull request has been merged. diff --git a/github/pulls_test.go b/github/pulls_test.go index 681211e..04638f7 100644 --- a/github/pulls_test.go +++ b/github/pulls_test.go @@ -174,7 +174,7 @@ func TestPullRequestsService_ListCommits(t *testing.T) { t.Errorf("PullRequests.ListCommits returned error: %v", err) } - want := &[]Commit{ + want := []Commit{ Commit{ SHA: String("3"), Parents: []Commit{ @@ -233,7 +233,7 @@ func TestPullRequestsService_ListFiles(t *testing.T) { t.Errorf("PullRequests.ListFiles returned error: %v", err) } - want := &[]CommitFile{ + want := []CommitFile{ CommitFile{ SHA: String("6dcb09b5b57875f334f61aebed695e2e4193db5e"), Filename: String("file1.txt"),