(e Engine)
| 99 | } |
| 100 | |
| 101 | func (r *Repository) getCollaborators(e Engine) ([]*Collaborator, error) { |
| 102 | collaborations, err := r.getCollaborations(e) |
| 103 | if err != nil { |
| 104 | return nil, errors.Newf("getCollaborations: %v", err) |
| 105 | } |
| 106 | |
| 107 | collaborators := make([]*Collaborator, len(collaborations)) |
| 108 | for i, c := range collaborations { |
| 109 | user, err := getUserByID(e, c.UserID) |
| 110 | if err != nil { |
| 111 | return nil, err |
| 112 | } |
| 113 | collaborators[i] = &Collaborator{ |
| 114 | User: user, |
| 115 | Collaboration: c, |
| 116 | } |
| 117 | } |
| 118 | return collaborators, nil |
| 119 | } |
| 120 | |
| 121 | // GetCollaborators returns the collaborators for a repository |
| 122 | func (r *Repository) GetCollaborators() ([]*Collaborator, error) { |
no test coverage detected