prow/github/client.go
func (c *Client) getLabels(path string) ([]Label, error) {
	var labels []Label
	if c.fake {
		return labels, nil
	}
	err := c.readPaginatedResults(
		path,
		"application/vnd.github.symmetra-preview+json", // allow the description field -- https://developer.github.com/changes/2018-02-22-label-description-search-preview/
		func() interface{} {
			return &[]Label{}
		},
		func(obj interface{}) {
			labels = append(labels, *(obj.(*[]Label))...)
		},
	)
	if err != nil {
		return nil, err
	}
	return labels, nil
}
func (c *Client) getLabels(path string) ([]Label, error) {
	var labels []Label
	if c.fake {
		return labels, nil
	}
	err := c.readPaginatedResults(
		path,
		"application/vnd.github.symmetra-preview+json", // allow the description field -- https://developer.github.com/changes/2018-02-22-label-description-search-preview/
		func() interface{} {
			return &[]Label{}
		},
		func(obj interface{}) {
			labels = append(labels, *(obj.(*[]Label))...)
		},
	)
	if err != nil {
		return nil, err
	}
	return labels, nil
}
func ( c * Client ) getLabels ( path string ) ( [ ] Label , error ) { var labels [ ] Label if c . fake { return labels , nil } err := c . readPaginatedResults ( path , " " , // allow the description field -- https://developer.github.com/changes/2018-02-22-label-description-search-preview/ func ( ) interface { } { return & [ ] Label { } } , func ( obj interface { } ) { labels = append ( labels , * ( obj . ( * [ ] Label ) ) ... ) } , ) if err != nil { return nil , err } return labels , nil }
// getLabels is a helper function that retrieves a paginated list of labels from a github URI path.
getLabels is a helper function that retrieves a paginated list of labels from a github URI path .