Skip to content

Commit 114802b

Browse files
author
Jakub Sarzyński
committed
Remove duplicate function
Function getCommentInfoMapResponse is equivalent to getCommentInfoMapSliceResponse. Keep the latter.
1 parent adf7cbe commit 114802b

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

changes.go

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ func (s *ChangesService) GetIncludedIn(changeID string) (*IncludedInInfo, *Respo
670670
// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-change-comments
671671
func (s *ChangesService) ListChangeComments(changeID string) (*map[string][]CommentInfo, *Response, error) {
672672
u := fmt.Sprintf("changes/%s/comments", changeID)
673-
return s.getCommentInfoMapResponse(u)
673+
return s.getCommentInfoMapSliceResponse(u)
674674
}
675675

676676
// Lists the robot comments of all revisions of the change.
@@ -689,23 +689,7 @@ func (s *ChangesService) ListChangeRobotComments(changeID string) (map[string][]
689689
// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-change-drafts
690690
func (s *ChangesService) ListChangeDrafts(changeID string) (*map[string][]CommentInfo, *Response, error) {
691691
u := fmt.Sprintf("changes/%s/drafts", changeID)
692-
return s.getCommentInfoMapResponse(u)
693-
}
694-
695-
// getCommentInfoMapResponse retrieved a map of CommentInfo Response for a GET request
696-
func (s *ChangesService) getCommentInfoMapResponse(u string) (*map[string][]CommentInfo, *Response, error) {
697-
req, err := s.client.NewRequest("GET", u, nil)
698-
if err != nil {
699-
return nil, nil, err
700-
}
701-
702-
v := new(map[string][]CommentInfo)
703-
resp, err := s.client.Do(req, v)
704-
if err != nil {
705-
return nil, resp, err
706-
}
707-
708-
return v, resp, err
692+
return s.getCommentInfoMapSliceResponse(u)
709693
}
710694

711695
// CheckChange performs consistency checks on the change, and returns a ChangeInfo entity with the problems field set to a list of ProblemInfo entities.

0 commit comments

Comments
 (0)