From 81218a0c7d3436c7f05e3f6cf60224d8be7463a3 Mon Sep 17 00:00:00 2001 From: nate smith Date: Thu, 10 Oct 2019 16:06:40 -0500 Subject: [PATCH] remove some dead code --- github/client.go | 39 --------------------------------------- github/remote.go | 8 -------- 2 files changed, 47 deletions(-) diff --git a/github/client.go b/github/client.go index e1855e15c..bd1272e90 100644 --- a/github/client.go +++ b/github/client.go @@ -35,45 +35,6 @@ type Client struct { cachedClient *simpleClient } -func (client *Client) FetchPullRequests(project *Project, filterParams map[string]interface{}, limit int, filter func(*PullRequest) bool) (pulls []PullRequest, err error) { - api, err := client.simpleApi() - if err != nil { - return - } - - path := fmt.Sprintf("repos/%s/%s/pulls?per_page=%d", project.Owner, project.Name, perPage(limit, 100)) - if filterParams != nil { - path = addQuery(path, filterParams) - } - - pulls = []PullRequest{} - var res *simpleResponse - - for path != "" { - res, err = api.GetFile(path, draftsType) - if err = checkStatus(200, "fetching pull requests", res, err); err != nil { - return - } - path = res.Link("next") - - pullsPage := []PullRequest{} - if err = res.Unmarshal(&pullsPage); err != nil { - return - } - for _, pr := range pullsPage { - if filter == nil || filter(&pr) { - pulls = append(pulls, pr) - if limit > 0 && len(pulls) == limit { - path = "" - break - } - } - } - } - - return -} - func (client *Client) PullRequest(project *Project, id string) (pr *PullRequest, err error) { api, err := client.simpleApi() if err != nil { diff --git a/github/remote.go b/github/remote.go index 80e4eaa55..e51266d93 100644 --- a/github/remote.go +++ b/github/remote.go @@ -23,14 +23,6 @@ func (remote *Remote) String() string { return remote.Name } -func (remote *Remote) Project() (*Project, error) { - p, err := NewProjectFromURL(remote.URL) - if _, ok := err.(*GithubHostError); ok { - return NewProjectFromURL(remote.PushURL) - } - return p, err -} - func Remotes() (remotes []Remote, err error) { re := regexp.MustCompile(`(.+)\s+(.+)\s+\((push|fetch)\)`)