Split function & fix lint
This commit is contained in:
parent
22cd08da7b
commit
9db8c10ff9
|
@ -65,20 +65,8 @@ func (ge *Gitea) Generate() (string, []Entry, error) {
|
|||
|
||||
for _, issue := range issues {
|
||||
if issue != nil {
|
||||
p := Entry{
|
||||
Index: issue.Index,
|
||||
Title: issue.Title,
|
||||
}
|
||||
|
||||
labels := make([]Label, len(issue.Labels))
|
||||
for idx, lbl := range issue.Labels {
|
||||
labels[idx] = Label{
|
||||
Name: lbl.Name,
|
||||
}
|
||||
}
|
||||
p.Labels = labels
|
||||
|
||||
entries = append(entries, p)
|
||||
entry := convertToEntiry(*issue)
|
||||
entries = append(entries, entry)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,6 +80,24 @@ func (ge *Gitea) Generate() (string, []Entry, error) {
|
|||
return tagURL, entries, nil
|
||||
}
|
||||
|
||||
func convertToEntiry(issue gitea.Issue) Entry {
|
||||
entry := Entry{
|
||||
Index: issue.Index,
|
||||
Title: issue.Title,
|
||||
}
|
||||
|
||||
labels := make([]Label, len(issue.Labels))
|
||||
for idx, lbl := range issue.Labels {
|
||||
labels[idx] = Label{
|
||||
Name: lbl.Name,
|
||||
}
|
||||
}
|
||||
|
||||
entry.Labels = labels
|
||||
|
||||
return entry
|
||||
}
|
||||
|
||||
// Contributors returns a list of contributors from Gitea
|
||||
func (ge *Gitea) Contributors() (ContributorList, error) {
|
||||
client := gitea.NewClient(ge.BaseURL, ge.Token)
|
||||
|
|
Loading…
Reference in New Issue