From 2979c5fc4cfa6f2351d2c83f1d69f060c51e78ca Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Thu, 12 Dec 2019 11:27:22 -0800 Subject: [PATCH] Use embeding --- api/queries_pr.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/api/queries_pr.go b/api/queries_pr.go index 8657b0891..01ece0369 100644 --- a/api/queries_pr.go +++ b/api/queries_pr.go @@ -50,11 +50,7 @@ type PullRequest struct { } type NotFoundError struct { - message string -} - -func (e *NotFoundError) Error() string { - return e.message + error } func (pr PullRequest) HeadLabel() string { @@ -376,7 +372,7 @@ func PullRequestForBranch(client *Client, ghRepo Repo, branch string) (*PullRequ } } - return nil, &NotFoundError{message: fmt.Sprintf("no open pull requests found for branch %q", branch)} + return nil, &NotFoundError{fmt.Errorf("no open pull requests found for branch %q", branch)} } func CreatePullRequest(client *Client, ghRepo Repo, params map[string]interface{}) (*PullRequest, error) {