Beispiel #1
0
func (r *Repo) GetMergeRequest(id int) (*client.MergeRequest, error) {
	merges, _, err := r.Client.MergeRequests.ListMergeRequests(r.Path,
		&client.ListMergeRequestsOptions{
			IID: client.Int(id),
		})
	if err != nil {
		return nil, err
	}
	if len(merges) < 1 {
		return nil, fmt.Errorf("Not found")
	}
	return merges[0], nil
}
Beispiel #2
0
func (r *Repo) GetIssue(id int) (*client.Issue, error) {
	issues, _, err := r.Client.Issues.ListProjectIssues(r.Path,
		&client.ListProjectIssuesOptions{
			IID: client.Int(id),
		})
	if err != nil {
		return nil, err
	}
	if len(issues) < 1 {
		return nil, fmt.Errorf("Not found")
	}
	return issues[0], nil
}