Permalink
Browse files

Return nil error explicitly when there is no error. (#550)

Follows #546.
Fully resolves #536.
  • Loading branch information...
1 parent 493b233 commit dfd20fd7fa6edec56447fcb049acd5e17a78ec2e @nspragg nspragg committed with shurcooL Feb 15, 2017
Showing with 11 additions and 9 deletions.
  1. +5 −3 github/github.go
  2. +3 −3 github/issues_events.go
  3. +3 −3 github/repos_comments.go
View
@@ -735,11 +735,13 @@ func category(path string) rateLimitCategory {
// Deprecated: RateLimit is deprecated, use RateLimits instead.
func (c *Client) RateLimit() (*Rate, *Response, error) {
limits, resp, err := c.RateLimits()
+ if err != nil {
+ return nil, resp, err
+ }
if limits == nil {
- return nil, nil, err
+ return nil, resp, errors.New("RateLimits returned nil limits and error; unable to extract Core rate limit")
}
-
- return limits.Core, resp, err
+ return limits.Core, resp, nil
}
// RateLimits returns the rate limits for the current client.
@@ -91,7 +91,7 @@ func (s *IssuesService) ListIssueEvents(owner, repo string, number int, opt *Lis
return nil, resp, err
}
- return events, resp, err
+ return events, resp, nil
}
// ListRepositoryEvents lists events for the specified repository.
@@ -115,7 +115,7 @@ func (s *IssuesService) ListRepositoryEvents(owner, repo string, opt *ListOption
return nil, resp, err
}
- return events, resp, err
+ return events, resp, nil
}
// GetEvent returns the specified issue event.
@@ -135,7 +135,7 @@ func (s *IssuesService) GetEvent(owner, repo string, id int) (*IssueEvent, *Resp
return nil, resp, err
}
- return event, resp, err
+ return event, resp, nil
}
// Rename contains details for 'renamed' events.
@@ -103,7 +103,7 @@ func (s *RepositoriesService) CreateComment(owner, repo, sha string, comment *Re
return nil, resp, err
}
- return c, resp, err
+ return c, resp, nil
}
// GetComment gets a single comment from a repository.
@@ -125,7 +125,7 @@ func (s *RepositoriesService) GetComment(owner, repo string, id int) (*Repositor
return nil, resp, err
}
- return c, resp, err
+ return c, resp, nil
}
// UpdateComment updates the body of a single comment.
@@ -144,7 +144,7 @@ func (s *RepositoriesService) UpdateComment(owner, repo string, id int, comment
return nil, resp, err
}
- return c, resp, err
+ return c, resp, nil
}
// DeleteComment deletes a single comment from a repository.

0 comments on commit dfd20fd

Please sign in to comment.