Skip to content

Commit 78c9d4c

Browse files
committed
fix lints
1 parent 19b2b7c commit 78c9d4c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

models/git/protected_branch.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,10 +417,12 @@ func UpdateProtectBranch(ctx context.Context, repo *repo_model.Repository, prote
417417
// as it's a new rule and if priority was not set, we need to calc it.
418418
if protectBranch.Priority == 0 {
419419
var lowestPrio int64
420-
db.GetEngine(ctx).Table(protectBranch).
420+
if _, err := db.GetEngine(ctx).Table(protectBranch).
421421
Select("MAX(priority)").
422422
Where("repo_id = ?", protectBranch.RepoID).
423-
Get(&lowestPrio)
423+
Get(&lowestPrio); err != nil {
424+
return err
425+
}
424426
log.Trace("Create new ProtectedBranch at repo[%d] and detect current lowest priority '%d'", protectBranch.RepoID, lowestPrio)
425427
protectBranch.Priority = lowestPrio + 1
426428
}

services/forms/repo_form.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ func (f *ProtectBranchForm) Validate(req *http.Request, errs binding.Errors) bin
228228
}
229229

230230
type ProtectBranchPriorityForm struct {
231-
IDS []int64
231+
IDs []int64
232232
}
233233

234234
// __ __ ___. .__ __

0 commit comments

Comments
 (0)