Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and [email protected] committed Mar 31, 2020
1 parent 78fd6ff commit 3e3788a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions ticket.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,19 @@ func (t Ticket) Assignee() User {
}

func (t Ticket) Followers() Users {
var users Users
if followers, ok := t["followers"].([]interface{}); ok {
for _, user := range followers {
users = append(users, User{
Self: toString(user.(map[string]interface{})["self"]),
ID: toString(user.(map[string]interface{})["id"]),
Display: toString(user.(map[string]interface{})["display"]),
})
users := make(Users, len(followers))
for i := range followers {
users[i] = User{
Self: toString(followers[i].(map[string]interface{})["self"]),
ID: toString(followers[i].(map[string]interface{})["id"]),
Display: toString(followers[i].(map[string]interface{})["display"]),
}
}
return users
}

return users
return Users{}
}

func (t Ticket) Summary() string {
Expand Down

0 comments on commit 3e3788a

Please sign in to comment.