// GetAllLabels gets all existing labels on a Github repository
GetAllLabels gets all existing labels on a Github repository
// GetAllLabels gets all existing labels on a Github repository
func (repo *Repository) GetAllLabels(token string) map[string]Label {
	url := fmt.Sprintf("/repos/%v/%v/labels?access_token=%v", repo.Owner.Name, repo.Name, token)
	var labels []Label
	if err := network.GetJSON(url, &labels); err != nil {
		fmt.Printf("Error getting labels for repository %v : %v\n", repo.Name, err)
	}
	labelsMap := make(map[string]Label)
	for _, element := range labels {
		labelsMap[element.Name] = element
	}
	return labelsMap
}
func ( repo * Repository ) GetAllLabels ( token string ) map [ string ] Label { url := fmt . Sprintf ( " " , repo . Owner . Name , repo . Name , token ) var labels [ ] Label if err := network . GetJSON ( url , & labels ) ; err != nil { fmt . Printf ( " \n " , repo . Name , err ) } labelsMap := make ( map [ string ] Label ) for _ , element := range labels { labelsMap [ element . Name ] = element } return labelsMap }
GetAllLabels gets all existing labels on a Github repository
GetAllLabels gets all existing labels on a Github repository