[API] ListIssues add filter for milestones (#10148)

* Refactor Issue Filter Func

* ListIssues add filter for milestones

* as per @lafriks

* documentation ...
This commit is contained in:
6543
2020-04-30 06:15:39 +02:00
committed by GitHub
parent cbf5dffaf2
commit bfda0f3864
10 changed files with 102 additions and 29 deletions

View File

@ -1560,6 +1560,7 @@ func (err ErrLabelNotExist) Error() string {
type ErrMilestoneNotExist struct {
ID int64
RepoID int64
Name string
}
// IsErrMilestoneNotExist checks if an error is a ErrMilestoneNotExist.
@ -1569,6 +1570,9 @@ func IsErrMilestoneNotExist(err error) bool {
}
func (err ErrMilestoneNotExist) Error() string {
if len(err.Name) > 0 {
return fmt.Sprintf("milestone does not exist [name: %s, repo_id: %d]", err.Name, err.RepoID)
}
return fmt.Sprintf("milestone does not exist [id: %d, repo_id: %d]", err.ID, err.RepoID)
}