@@ -47,7 +47,7 @@ func IsErrIssueIsClosed(err error) bool {
4747}
4848
4949func (err ErrIssueIsClosed ) Error () string {
50- return fmt .Sprintf ("%s [id: %d, repo_id: %d, index: %d] is already closed" , util .Iif (err .IsPull , "Pull Request" , "Issue" ), err .ID , err .RepoID , err .Index )
50+ return fmt .Sprintf ("%s [id: %d, repo_id: %d, index: %d] is already closed" , util .Ternary (err .IsPull , "Pull Request" , "Issue" ), err .ID , err .RepoID , err .Index )
5151}
5252
5353func SetIssueAsClosed (ctx context.Context , issue * Issue , doer * user_model.User , isMergePull bool ) (* Comment , error ) {
@@ -84,7 +84,7 @@ func SetIssueAsClosed(ctx context.Context, issue *Issue, doer *user_model.User,
8484 return nil , ErrIssueAlreadyChanged
8585 }
8686
87- return updateIssueNumbers (ctx , issue , doer , util .Iif (isMergePull , CommentTypeMergePull , CommentTypeClose ))
87+ return updateIssueNumbers (ctx , issue , doer , util .Ternary (isMergePull , CommentTypeMergePull , CommentTypeClose ))
8888}
8989
9090// ErrIssueIsOpen is used when reopen an opened issue
@@ -102,7 +102,7 @@ func IsErrIssueIsOpen(err error) bool {
102102}
103103
104104func (err ErrIssueIsOpen ) Error () string {
105- return fmt .Sprintf ("%s [id: %d, repo_id: %d, index: %d] is already open" , util .Iif (err .IsPull , "Pull Request" , "Issue" ), err .ID , err .RepoID , err .Index )
105+ return fmt .Sprintf ("%s [id: %d, repo_id: %d, index: %d] is already open" , util .Ternary (err .IsPull , "Pull Request" , "Issue" ), err .ID , err .RepoID , err .Index )
106106}
107107
108108func setIssueAsReopen (ctx context.Context , issue * Issue , doer * user_model.User ) (* Comment , error ) {
0 commit comments