Skip to content

Commit 30a21ee

Browse files
Nick Spraggdmitshur
authored andcommitted
Return nil error explicitly when there is no error. (google#546)
Helps google#536. Follows google#542.
1 parent 9cb398c commit 30a21ee

36 files changed

+113
-113
lines changed

github/activity_notifications.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (s *ActivityService) ListNotifications(opt *NotificationListOptions) ([]*No
6767
return nil, resp, err
6868
}
6969

70-
return notifications, resp, err
70+
return notifications, resp, nil
7171
}
7272

7373
// ListRepositoryNotifications lists all notifications in a given repository
@@ -92,7 +92,7 @@ func (s *ActivityService) ListRepositoryNotifications(owner, repo string, opt *N
9292
return nil, resp, err
9393
}
9494

95-
return notifications, resp, err
95+
return notifications, resp, nil
9696
}
9797

9898
type markReadOptions struct {
@@ -148,7 +148,7 @@ func (s *ActivityService) GetThread(id string) (*Notification, *Response, error)
148148
return nil, resp, err
149149
}
150150

151-
return notification, resp, err
151+
return notification, resp, nil
152152
}
153153

154154
// MarkThreadRead marks the specified thread as read.
@@ -183,7 +183,7 @@ func (s *ActivityService) GetThreadSubscription(id string) (*Subscription, *Resp
183183
return nil, resp, err
184184
}
185185

186-
return sub, resp, err
186+
return sub, resp, nil
187187
}
188188

189189
// SetThreadSubscription sets the subscription for the specified thread for the
@@ -204,7 +204,7 @@ func (s *ActivityService) SetThreadSubscription(id string, subscription *Subscri
204204
return nil, resp, err
205205
}
206206

207-
return sub, resp, err
207+
return sub, resp, nil
208208
}
209209

210210
// DeleteThreadSubscription deletes the subscription for the specified thread

github/activity_watching.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func (s *ActivityService) GetRepositorySubscription(owner, repo string) (*Subscr
9797
return nil, resp, err
9898
}
9999

100-
return sub, resp, err
100+
return sub, resp, nil
101101
}
102102

103103
// SetRepositorySubscription sets the subscription for the specified repository
@@ -122,7 +122,7 @@ func (s *ActivityService) SetRepositorySubscription(owner, repo string, subscrip
122122
return nil, resp, err
123123
}
124124

125-
return sub, resp, err
125+
return sub, resp, nil
126126
}
127127

128128
// DeleteRepositorySubscription deletes the subscription for the specified

github/admin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func (s *AdminService) UpdateUserLDAPMapping(user string, mapping *UserLDAPMappi
7575
return nil, resp, err
7676
}
7777

78-
return m, resp, err
78+
return m, resp, nil
7979
}
8080

8181
// UpdateTeamLDAPMapping updates the mapping between a GitHub team and an LDAP group.
@@ -94,5 +94,5 @@ func (s *AdminService) UpdateTeamLDAPMapping(team int, mapping *TeamLDAPMapping)
9494
return nil, resp, err
9595
}
9696

97-
return m, resp, err
97+
return m, resp, nil
9898
}

github/authorizations.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func (s *AuthorizationsService) Get(id int) (*Authorization, *Response, error) {
170170
if err != nil {
171171
return nil, resp, err
172172
}
173-
return a, resp, err
173+
return a, resp, nil
174174
}
175175

176176
// Create a new authorization for the specified OAuth application.
@@ -189,7 +189,7 @@ func (s *AuthorizationsService) Create(auth *AuthorizationRequest) (*Authorizati
189189
if err != nil {
190190
return nil, resp, err
191191
}
192-
return a, resp, err
192+
return a, resp, nil
193193
}
194194

195195
// GetOrCreateForApp creates a new authorization for the specified OAuth
@@ -225,7 +225,7 @@ func (s *AuthorizationsService) GetOrCreateForApp(clientID string, auth *Authori
225225
return nil, resp, err
226226
}
227227

228-
return a, resp, err
228+
return a, resp, nil
229229
}
230230

231231
// Edit a single authorization.
@@ -245,7 +245,7 @@ func (s *AuthorizationsService) Edit(id int, auth *AuthorizationUpdateRequest) (
245245
return nil, resp, err
246246
}
247247

248-
return a, resp, err
248+
return a, resp, nil
249249
}
250250

251251
// Delete a single authorization.
@@ -285,7 +285,7 @@ func (s *AuthorizationsService) Check(clientID string, token string) (*Authoriza
285285
return nil, resp, err
286286
}
287287

288-
return a, resp, err
288+
return a, resp, nil
289289
}
290290

291291
// Reset is used to reset a valid OAuth token without end user involvement.
@@ -313,7 +313,7 @@ func (s *AuthorizationsService) Reset(clientID string, token string) (*Authoriza
313313
return nil, resp, err
314314
}
315315

316-
return a, resp, err
316+
return a, resp, nil
317317
}
318318

319319
// Revoke an authorization for an application.
@@ -352,7 +352,7 @@ func (s *AuthorizationsService) ListGrants() ([]*Grant, *Response, error) {
352352
return nil, resp, err
353353
}
354354

355-
return grants, resp, err
355+
return grants, resp, nil
356356
}
357357

358358
// GetGrant gets a single OAuth application grant.
@@ -371,7 +371,7 @@ func (s *AuthorizationsService) GetGrant(id int) (*Grant, *Response, error) {
371371
return nil, resp, err
372372
}
373373

374-
return grant, resp, err
374+
return grant, resp, nil
375375
}
376376

377377
// DeleteGrant deletes an OAuth application grant. Deleting an application's
@@ -408,7 +408,7 @@ func (s *AuthorizationsService) CreateImpersonation(username string, authReq *Au
408408
if err != nil {
409409
return nil, resp, err
410410
}
411-
return a, resp, err
411+
return a, resp, nil
412412
}
413413

414414
// DeleteImpersonation deletes an impersonation OAuth token.

github/gists.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ func (s *GistsService) Get(id string) (*Gist, *Response, error) {
180180
return nil, resp, err
181181
}
182182

183-
return gist, resp, err
183+
return gist, resp, nil
184184
}
185185

186186
// GetRevision gets a specific revision of a gist.
@@ -198,7 +198,7 @@ func (s *GistsService) GetRevision(id, sha string) (*Gist, *Response, error) {
198198
return nil, resp, err
199199
}
200200

201-
return gist, resp, err
201+
return gist, resp, nil
202202
}
203203

204204
// Create a gist for authenticated user.
@@ -216,7 +216,7 @@ func (s *GistsService) Create(gist *Gist) (*Gist, *Response, error) {
216216
return nil, resp, err
217217
}
218218

219-
return g, resp, err
219+
return g, resp, nil
220220
}
221221

222222
// Edit a gist.
@@ -234,7 +234,7 @@ func (s *GistsService) Edit(id string, gist *Gist) (*Gist, *Response, error) {
234234
return nil, resp, err
235235
}
236236

237-
return g, resp, err
237+
return g, resp, nil
238238
}
239239

240240
// ListCommits lists commits of a gist.
@@ -322,7 +322,7 @@ func (s *GistsService) Fork(id string) (*Gist, *Response, error) {
322322
return nil, resp, err
323323
}
324324

325-
return g, resp, err
325+
return g, resp, nil
326326
}
327327

328328
// ListForks lists forks of a gist.

github/gists_comments.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func (s *GistsService) GetComment(gistID string, commentID int) (*GistComment, *
6363
return nil, resp, err
6464
}
6565

66-
return c, resp, err
66+
return c, resp, nil
6767
}
6868

6969
// CreateComment creates a comment for a gist.
@@ -82,7 +82,7 @@ func (s *GistsService) CreateComment(gistID string, comment *GistComment) (*Gist
8282
return nil, resp, err
8383
}
8484

85-
return c, resp, err
85+
return c, resp, nil
8686
}
8787

8888
// EditComment edits an existing gist comment.
@@ -101,7 +101,7 @@ func (s *GistsService) EditComment(gistID string, commentID int, comment *GistCo
101101
return nil, resp, err
102102
}
103103

104-
return c, resp, err
104+
return c, resp, nil
105105
}
106106

107107
// DeleteComment deletes a gist comment.

github/git_commits.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (s *GitService) GetCommit(owner string, repo string, sha string) (*Commit,
7474
return nil, resp, err
7575
}
7676

77-
return c, resp, err
77+
return c, resp, nil
7878
}
7979

8080
// createCommit represents the body of a CreateCommit request.
@@ -123,5 +123,5 @@ func (s *GitService) CreateCommit(owner string, repo string, commit *Commit) (*C
123123
return nil, resp, err
124124
}
125125

126-
return c, resp, err
126+
return c, resp, nil
127127
}

github/git_refs.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func (s *GitService) GetRef(owner string, repo string, ref string) (*Reference,
6161
return nil, resp, err
6262
}
6363

64-
return r, resp, err
64+
return r, resp, nil
6565
}
6666

6767
// ReferenceListOptions specifies optional parameters to the
@@ -98,7 +98,7 @@ func (s *GitService) ListRefs(owner, repo string, opt *ReferenceListOptions) ([]
9898
return nil, resp, err
9999
}
100100

101-
return rs, resp, err
101+
return rs, resp, nil
102102
}
103103

104104
// CreateRef creates a new ref in a repository.
@@ -121,7 +121,7 @@ func (s *GitService) CreateRef(owner string, repo string, ref *Reference) (*Refe
121121
return nil, resp, err
122122
}
123123

124-
return r, resp, err
124+
return r, resp, nil
125125
}
126126

127127
// UpdateRef updates an existing ref in a repository.
@@ -144,7 +144,7 @@ func (s *GitService) UpdateRef(owner string, repo string, ref *Reference, force
144144
return nil, resp, err
145145
}
146146

147-
return r, resp, err
147+
return r, resp, nil
148148
}
149149

150150
// DeleteRef deletes a ref from a repository.

github/git_trees.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func (s *GitService) GetTree(owner string, repo string, sha string, recursive bo
5353
return nil, resp, err
5454
}
5555

56-
return t, resp, err
56+
return t, resp, nil
5757
}
5858

5959
// createTree represents the body of a CreateTree request.
@@ -85,5 +85,5 @@ func (s *GitService) CreateTree(owner string, repo string, baseTree string, entr
8585
return nil, resp, err
8686
}
8787

88-
return t, resp, err
88+
return t, resp, nil
8989
}

github/github.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ func (c *Client) RateLimits() (*RateLimits, *Response, error) {
768768
c.rateMu.Unlock()
769769
}
770770

771-
return response.Resources, resp, err
771+
return response.Resources, resp, nil
772772
}
773773

774774
/*

0 commit comments

Comments
 (0)