Skip to content

Commit

Permalink
Follow github changes after updating
Browse files Browse the repository at this point in the history
`go vet` fails due to github library changes::

k8s.io/test-infra/ghclient
 ghclient/core.go:60:14: cannot use client.Repositories
   (type *github.RepositoriesService) as type repositoryService
   in field value:
 *github.RepositoriesService does not implement repositoryService
   (wrong type for ListCollaborators method)
   have ListCollaborators(context.Context, string, string, *github.ListCollaboratorsOptions)
      ([]*github.User *github.Response, error)
   want ListCollaborators(context.Context, string, string, *github.ListOptions)
      ([]*github.User, *github.Response error)

This patch makes ghclient follow these changes.
  • Loading branch information
Ken'ichi Ohmichi committed Dec 16, 2017
1 parent bb55455 commit fa0f7a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ghclient/wrappers.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type pullRequestService interface {
type repositoryService interface {
CreateStatus(ctx context.Context, org, repo, ref string, status *github.RepoStatus) (*github.RepoStatus, *github.Response, error)
GetCombinedStatus(ctx context.Context, org, repo, ref string, opt *github.ListOptions) (*github.CombinedStatus, *github.Response, error)
ListCollaborators(ctx context.Context, owner, repo string, opt *github.ListOptions) ([]*github.User, *github.Response, error)
ListCollaborators(ctx context.Context, owner, repo string, opt *github.ListCollaboratorsOptions) ([]*github.User, *github.Response, error)
}

type usersService interface {
Expand Down Expand Up @@ -143,7 +143,7 @@ func (c *Client) ForEachPR(owner, repo string, opts *github.PullRequestListOptio

// GetCollaborators returns all github users who are members or outside collaborators of the repo.
func (c *Client) GetCollaborators(org, repo string) ([]*github.User, error) {
opts := &github.ListOptions{}
opts := &github.ListCollaboratorsOptions{}
collaborators, err := c.depaginate(
fmt.Sprintf("getting collaborators for '%s/%s'", org, repo),
opts,
Expand Down

0 comments on commit fa0f7a8

Please sign in to comment.