Skip to content

Commit

Permalink
Return nil if no error.
Browse files Browse the repository at this point in the history
If err was already checked, return nil for readability.

Signed-off-by: Wim Fournier <github@fournier.nl>
  • Loading branch information
hsmade committed Apr 25, 2023
1 parent fcf57a4 commit 02cb9ba
Show file tree
Hide file tree
Showing 106 changed files with 595 additions and 595 deletions.
12 changes: 6 additions & 6 deletions access_requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (s *AccessRequestsService) ListProjectAccessRequests(pid interface{}, opt *
return nil, resp, err
}

return ars, resp, err
return ars, resp, nil
}

// ListGroupAccessRequests gets a list of access requests
Expand All @@ -100,7 +100,7 @@ func (s *AccessRequestsService) ListGroupAccessRequests(gid interface{}, opt *Li
return nil, resp, err
}

return ars, resp, err
return ars, resp, nil
}

// RequestProjectAccess requests access for the authenticated user
Expand All @@ -126,7 +126,7 @@ func (s *AccessRequestsService) RequestProjectAccess(pid interface{}, options ..
return nil, resp, err
}

return ar, resp, err
return ar, resp, nil
}

// RequestGroupAccess requests access for the authenticated user
Expand All @@ -152,7 +152,7 @@ func (s *AccessRequestsService) RequestGroupAccess(gid interface{}, options ...R
return nil, resp, err
}

return ar, resp, err
return ar, resp, nil
}

// ApproveAccessRequestOptions represents the available
Expand Down Expand Up @@ -186,7 +186,7 @@ func (s *AccessRequestsService) ApproveProjectAccessRequest(pid interface{}, use
return nil, resp, err
}

return ar, resp, err
return ar, resp, nil
}

// ApproveGroupAccessRequest approves an access request for the given user.
Expand All @@ -211,7 +211,7 @@ func (s *AccessRequestsService) ApproveGroupAccessRequest(gid interface{}, user
return nil, resp, err
}

return ar, resp, err
return ar, resp, nil
}

// DenyProjectAccessRequest denies an access request for the given user.
Expand Down
4 changes: 2 additions & 2 deletions applications.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (s *ApplicationsService) CreateApplication(opt *CreateApplicationOptions, o
return nil, resp, err
}

return a, resp, err
return a, resp, nil
}

// ListApplicationsOptions represents the available
Expand All @@ -87,7 +87,7 @@ func (s *ApplicationsService) ListApplications(opt *ListApplicationsOptions, opt
return nil, resp, err
}

return as, resp, err
return as, resp, nil
}

// DeleteApplication removes a specific application.
Expand Down
12 changes: 6 additions & 6 deletions audit_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (s *AuditEventsService) ListInstanceAuditEvents(opt *ListAuditEventsOptions
return nil, resp, err
}

return aes, resp, err
return aes, resp, nil
}

// GetInstanceAuditEvent gets a specific instance audit event.
Expand All @@ -96,7 +96,7 @@ func (s *AuditEventsService) GetInstanceAuditEvent(event int, options ...Request
return nil, resp, err
}

return ae, resp, err
return ae, resp, nil
}

// ListGroupAuditEvents gets a list of audit events for the specified group
Expand All @@ -121,7 +121,7 @@ func (s *AuditEventsService) ListGroupAuditEvents(gid interface{}, opt *ListAudi
return nil, resp, err
}

return aes, resp, err
return aes, resp, nil
}

// GetGroupAuditEvent gets a specific group audit event.
Expand All @@ -145,7 +145,7 @@ func (s *AuditEventsService) GetGroupAuditEvent(gid interface{}, event int, opti
return nil, resp, err
}

return ae, resp, err
return ae, resp, nil
}

// ListProjectAuditEvents gets a list of audit events for the specified project
Expand All @@ -170,7 +170,7 @@ func (s *AuditEventsService) ListProjectAuditEvents(pid interface{}, opt *ListAu
return nil, resp, err
}

return aes, resp, err
return aes, resp, nil
}

// GetProjectAuditEvent gets a specific project audit event.
Expand All @@ -195,5 +195,5 @@ func (s *AuditEventsService) GetProjectAuditEvent(pid interface{}, event int, op
return nil, resp, err
}

return ae, resp, err
return ae, resp, nil
}
12 changes: 6 additions & 6 deletions award_emojis.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (s *AwardEmojiService) listAwardEmoji(pid interface{}, resource string, res
return nil, resp, err
}

return as, resp, err
return as, resp, nil
}

// GetMergeRequestAwardEmoji get an award emoji from merge request.
Expand Down Expand Up @@ -159,7 +159,7 @@ func (s *AwardEmojiService) getAwardEmoji(pid interface{}, resource string, reso
return nil, resp, err
}

return a, resp, err
return a, resp, nil
}

// CreateAwardEmojiOptions represents the available options for awarding emoji
Expand Down Expand Up @@ -217,7 +217,7 @@ func (s *AwardEmojiService) createAwardEmoji(pid interface{}, resource string, r
return nil, resp, err
}

return a, resp, err
return a, resp, nil
}

// DeleteIssueAwardEmoji delete award emoji on an issue.
Expand Down Expand Up @@ -309,7 +309,7 @@ func (s *AwardEmojiService) listAwardEmojiOnNote(pid interface{}, resources stri
return nil, resp, err
}

return as, resp, err
return as, resp, nil
}

// GetIssuesAwardEmojiOnNote gets an award emoji on a note from an issue.
Expand Down Expand Up @@ -362,7 +362,7 @@ func (s *AwardEmojiService) getSingleNoteAwardEmoji(pid interface{}, ressource s
return nil, resp, err
}

return a, resp, err
return a, resp, nil
}

// CreateIssuesAwardEmojiOnNote gets an award emoji on a note from an issue.
Expand Down Expand Up @@ -417,7 +417,7 @@ func (s *AwardEmojiService) createAwardEmojiOnNote(pid interface{}, resource str
return nil, resp, err
}

return a, resp, err
return a, resp, nil
}

// DeleteIssuesAwardEmojiOnNote deletes an award emoji on a note from an issue.
Expand Down
16 changes: 8 additions & 8 deletions boards.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (s *IssueBoardsService) CreateIssueBoard(pid interface{}, opt *CreateIssueB
return nil, resp, err
}

return board, resp, err
return board, resp, nil
}

// UpdateIssueBoardOptions represents the available UpdateIssueBoard() options.
Expand Down Expand Up @@ -139,7 +139,7 @@ func (s *IssueBoardsService) UpdateIssueBoard(pid interface{}, board int, opt *U
return nil, resp, err
}

return is, resp, err
return is, resp, nil
}

// DeleteIssueBoard deletes an issue board.
Expand Down Expand Up @@ -186,7 +186,7 @@ func (s *IssueBoardsService) ListIssueBoards(pid interface{}, opt *ListIssueBoar
return nil, resp, err
}

return is, resp, err
return is, resp, nil
}

// GetIssueBoard gets a single issue board of a project.
Expand All @@ -210,7 +210,7 @@ func (s *IssueBoardsService) GetIssueBoard(pid interface{}, board int, options .
return nil, resp, err
}

return ib, resp, err
return ib, resp, nil
}

// GetIssueBoardListsOptions represents the available GetIssueBoardLists() options.
Expand Down Expand Up @@ -240,7 +240,7 @@ func (s *IssueBoardsService) GetIssueBoardLists(pid interface{}, board int, opt
return nil, resp, err
}

return bl, resp, err
return bl, resp, nil
}

// GetIssueBoardList gets a single issue board list.
Expand Down Expand Up @@ -268,7 +268,7 @@ func (s *IssueBoardsService) GetIssueBoardList(pid interface{}, board, list int,
return nil, resp, err
}

return bl, resp, err
return bl, resp, nil
}

// CreateIssueBoardListOptions represents the available CreateIssueBoardList()
Expand Down Expand Up @@ -303,7 +303,7 @@ func (s *IssueBoardsService) CreateIssueBoardList(pid interface{}, board int, op
return nil, resp, err
}

return bl, resp, err
return bl, resp, nil
}

// UpdateIssueBoardListOptions represents the available UpdateIssueBoardList()
Expand Down Expand Up @@ -339,7 +339,7 @@ func (s *IssueBoardsService) UpdateIssueBoardList(pid interface{}, board, list i
return nil, resp, err
}

return bl, resp, err
return bl, resp, nil
}

// DeleteIssueBoardList soft deletes an issue board list. Only for admins and
Expand Down
10 changes: 5 additions & 5 deletions branches.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (s *BranchesService) ListBranches(pid interface{}, opts *ListBranchesOption
return nil, resp, err
}

return b, resp, err
return b, resp, nil
}

// GetBranch gets a single project repository branch.
Expand All @@ -106,7 +106,7 @@ func (s *BranchesService) GetBranch(pid interface{}, branch string, options ...R
return nil, resp, err
}

return b, resp, err
return b, resp, nil
}

// ProtectBranchOptions represents the available ProtectBranch() options.
Expand Down Expand Up @@ -145,7 +145,7 @@ func (s *BranchesService) ProtectBranch(pid interface{}, branch string, opts *Pr
return nil, resp, err
}

return b, resp, err
return b, resp, nil
}

// UnprotectBranch unprotects a single project repository branch. This is an
Expand Down Expand Up @@ -175,7 +175,7 @@ func (s *BranchesService) UnprotectBranch(pid interface{}, branch string, option
return nil, resp, err
}

return b, resp, err
return b, resp, nil
}

// CreateBranchOptions represents the available CreateBranch() options.
Expand Down Expand Up @@ -209,7 +209,7 @@ func (s *BranchesService) CreateBranch(pid interface{}, opt *CreateBranchOptions
return nil, resp, err
}

return b, resp, err
return b, resp, nil
}

// DeleteBranch deletes an existing branch.
Expand Down
8 changes: 4 additions & 4 deletions broadcast_messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (s *BroadcastMessagesService) ListBroadcastMessages(opt *ListBroadcastMessa
return nil, resp, err
}

return bs, resp, err
return bs, resp, nil
}

// GetBroadcastMessage gets a single broadcast message.
Expand All @@ -94,7 +94,7 @@ func (s *BroadcastMessagesService) GetBroadcastMessage(broadcast int, options ..
return nil, resp, err
}

return b, resp, err
return b, resp, nil
}

// CreateBroadcastMessageOptions represents the available CreateBroadcastMessage()
Expand Down Expand Up @@ -132,7 +132,7 @@ func (s *BroadcastMessagesService) CreateBroadcastMessage(opt *CreateBroadcastMe
return nil, resp, err
}

return b, resp, err
return b, resp, nil
}

// UpdateBroadcastMessageOptions represents the available CreateBroadcastMessage()
Expand Down Expand Up @@ -172,7 +172,7 @@ func (s *BroadcastMessagesService) UpdateBroadcastMessage(broadcast int, opt *Up
return nil, resp, err
}

return b, resp, err
return b, resp, nil
}

// DeleteBroadcastMessage deletes a broadcasted message.
Expand Down
4 changes: 2 additions & 2 deletions ci_yml_templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (s *CIYMLTemplatesService) ListAllTemplates(opt *ListCIYMLTemplatesOptions,
return nil, resp, err
}

return cts, resp, err
return cts, resp, nil
}

// GetTemplate get a single GitLab CI YML template.
Expand All @@ -91,5 +91,5 @@ func (s *CIYMLTemplatesService) GetTemplate(key string, options ...RequestOption
return nil, resp, err
}

return ct, resp, err
return ct, resp, nil
}
Loading

0 comments on commit 02cb9ba

Please sign in to comment.