Skip to content

Commit ce83609

Browse files

File tree

18 files changed

+105
-119
lines changed

18 files changed

+105
-119
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ XGO_VERSION := go-1.21.x
2828
AIR_PACKAGE ?= github.com/cosmtrek/[email protected]
2929
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/[email protected]
3030
GOFUMPT_PACKAGE ?= mvdan.cc/[email protected]
31-
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.1
31+
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.0
3232
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/[email protected]
3333
MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/[email protected]
3434
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/[email protected]

models/actions/task.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ func CreateTaskForRunner(ctx context.Context, runner *ActionRunner) (*ActionTask
279279
return nil, false, fmt.Errorf("parse workflow of job %d: %w", job.ID, err)
280280
} else if len(gots) != 1 {
281281
return nil, false, fmt.Errorf("workflow of job %d: not single workflow", job.ID)
282-
} else {
282+
} else { //nolint:revive
283283
_, workflowJob = gots[0].Job()
284284
}
285285

models/activities/action.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,9 +713,8 @@ func DeleteIssueActions(ctx context.Context, repoID, issueID, issueIndex int64)
713713
break
714714
} else if _, err = db.GetEngine(ctx).In("comment_id", commentIDs).Delete(&Action{}); err != nil {
715715
return err
716-
} else {
717-
lastCommentID = commentIDs[len(commentIDs)-1]
718716
}
717+
lastCommentID = commentIDs[len(commentIDs)-1]
719718
}
720719

721720
_, err := e.Where("repo_id = ?", repoID).

models/issues/review.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,8 @@ func GetReviewByID(ctx context.Context, id int64) (*Review, error) {
213213
return nil, err
214214
} else if !has {
215215
return nil, ErrReviewNotExist{ID: id}
216-
} else {
217-
return review, nil
218216
}
217+
return review, nil
219218
}
220219

221220
// CreateReviewOptions represent the options to create a review. Type, Issue and Reviewer are required.

modules/activitypub/user_settings.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@ func GetKeyPair(ctx context.Context, user *user_model.User) (pub, priv string, e
2929
return pub, priv, err
3030
}
3131
return pub, priv, err
32-
} else {
33-
priv = settings[user_model.UserActivityPubPrivPem].SettingValue
34-
pub = settings[user_model.UserActivityPubPubPem].SettingValue
35-
return pub, priv, err
3632
}
33+
priv = settings[user_model.UserActivityPubPrivPem].SettingValue
34+
pub = settings[user_model.UserActivityPubPubPem].SettingValue
35+
return pub, priv, err
3736
}
3837

3938
// GetPublicKey function returns a user's public key

modules/git/submodule.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,8 @@ func getRefURL(refURL, urlPrefix, repoFullName, sshDomain string) string {
101101
return ref.Scheme + "://" + ref.Host + ref.Path
102102
} else if urlPrefixHostname == refHostname || refHostname == sshDomain {
103103
return urlPrefix + path.Clean(path.Join("/", ref.Path))
104-
} else {
105-
return "http://" + refHostname + ref.Path
106104
}
105+
return "http://" + refHostname + ref.Path
107106
}
108107
}
109108

modules/lfs/transferadapter_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,9 @@ func TestBasicTransferAdapter(t *testing.T) {
6262
json.NewEncoder(payload).Encode(er)
6363

6464
return &http.Response{StatusCode: http.StatusNotFound, Body: io.NopCloser(payload)}
65-
} else {
66-
t.Errorf("Unknown test case: %s", url)
67-
return nil
6865
}
66+
t.Errorf("Unknown test case: %s", url)
67+
return nil
6968
}
7069

7170
hc := &http.Client{Transport: RoundTripFunc(roundTripHandler)}

0 commit comments

Comments
 (0)