From 1f85815a3b5bf2df380b32818754ae0e183280b0 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 22 Aug 2020 16:22:07 +0100 Subject: [PATCH] models: break out of loop (#12386) (#12561) Backport #12386 Co-authored-by: Lars Lehtonen --- models/pull_sign.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/models/pull_sign.go b/models/pull_sign.go index 91b8defa5..ab61232d6 100644 --- a/models/pull_sign.go +++ b/models/pull_sign.go @@ -27,12 +27,13 @@ func (pr *PullRequest) SignMerge(u *User, tmpBasePath, baseCommit, headCommit st var gitRepo *git.Repository var err error +Loop: for _, rule := range rules { switch rule { case never: return false, "", &ErrWontSign{never} case always: - break + break Loop case pubkey: keys, err := ListGPGKeys(u.ID, ListOptions{}) if err != nil {