Skip to content

Commit 39ca895

Browse files
committed
Fix lint
1 parent 4cd4541 commit 39ca895

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

models/issues/issue_update.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,12 @@ func updateIssueNumbers(ctx context.Context, issue *Issue, doer *user_model.User
148148
colName := util.Iif(issue.IsPull, "num_closed_pulls", "num_closed_issues")
149149
dbSession := db.GetEngine(ctx)
150150
// update repository's issue closed number
151-
if cmtType == CommentTypeClose || cmtType == CommentTypeMergePull {
151+
switch cmtType {
152+
case CommentTypeClose, CommentTypeMergePull:
152153
dbSession.Incr(colName)
153-
} else if cmtType == CommentTypeReopen {
154+
case CommentTypeReopen:
154155
dbSession.Decr(colName)
155-
} else {
156+
default:
156157
return nil, fmt.Errorf("invalid comment type: %d", cmtType)
157158
}
158159
if _, err := dbSession.ID(issue.RepoID).

0 commit comments

Comments
 (0)