Commit ad922c4d authored by Maxime Roussin-Bélanger's avatar Maxime Roussin-Bélanger Committed by Sander van Harmelen

Add missing ListOptions to ListLabels (#337)

Fixes : #336
parent 79bdeb00
......@@ -21,7 +21,7 @@ func labelExample() {
log.Printf("Created label: %s\nWith color: %s\n", label.Name, label.Color)
// List all labels
labels, _, err := git.Labels.ListLabels("myname/myproject")
labels, _, err := git.Labels.ListLabels("myname/myproject", nil)
if err != nil {
log.Fatal(err)
}
......
......@@ -48,17 +48,22 @@ func (l Label) String() string {
return Stringify(l)
}
// ListLabelsOptions represents the available ListLabels() options.
//
// GitLab API docs: https://docs.gitlab.com/ce/api/labels.html#list-labels
type ListLabelsOptions ListOptions
// ListLabels gets all labels for given project.
//
// GitLab API docs: https://docs.gitlab.com/ce/api/labels.html#list-labels
func (s *LabelsService) ListLabels(pid interface{}, options ...OptionFunc) ([]*Label, *Response, error) {
func (s *LabelsService) ListLabels(pid interface{}, opt *ListLabelsOptions, options ...OptionFunc) ([]*Label, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
}
u := fmt.Sprintf("projects/%s/labels", url.QueryEscape(project))
req, err := s.client.NewRequest("GET", u, nil, options)
req, err := s.client.NewRequest("GET", u, opt, options)
if err != nil {
return nil, nil, err
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment