1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

format with gofumpt (#18184)

* gofumpt -w -l .

* gofumpt -w -l -extra .

* Add linter

* manual fix

* change make fmt
This commit is contained in:
6543
2022-01-20 18:46:10 +01:00
committed by GitHub
parent 1d98d205f5
commit 54e9ee37a7
423 changed files with 1585 additions and 1758 deletions

View File

@@ -48,16 +48,14 @@ const (
pullRequestTemplateKey = "PullRequestTemplate"
)
var (
pullRequestTemplateCandidates = []string{
"PULL_REQUEST_TEMPLATE.md",
"pull_request_template.md",
".gitea/PULL_REQUEST_TEMPLATE.md",
".gitea/pull_request_template.md",
".github/PULL_REQUEST_TEMPLATE.md",
".github/pull_request_template.md",
}
)
var pullRequestTemplateCandidates = []string{
"PULL_REQUEST_TEMPLATE.md",
"pull_request_template.md",
".gitea/PULL_REQUEST_TEMPLATE.md",
".gitea/pull_request_template.md",
".github/PULL_REQUEST_TEMPLATE.md",
".github/pull_request_template.md",
}
func getRepository(ctx *context.Context, repoID int64) *repo_model.Repository {
repo, err := repo_model.GetRepositoryByID(repoID)
@@ -125,7 +123,7 @@ func getForkRepository(ctx *context.Context) *repo_model.Repository {
}
}
var traverseParentRepo = forkRepo
traverseParentRepo := forkRepo
for {
if ctx.User.ID == traverseParentRepo.OwnerID {
canForkToUser = false
@@ -195,7 +193,7 @@ func ForkPost(ctx *context.Context) {
}
var err error
var traverseParentRepo = forkRepo
traverseParentRepo := forkRepo
for {
if ctxUser.ID == traverseParentRepo.OwnerID {
ctx.RenderWithErr(ctx.Tr("repo.settings.new_owner_has_same_repo"), tplFork, &form)
@@ -1085,7 +1083,6 @@ func MergePullRequest(ctx *context.Context) {
}
func stopTimerIfAvailable(user *user_model.User, issue *models.Issue) error {
if models.StopwatchExists(user.ID, issue.ID) {
if err := models.CreateOrStopIssueStopwatch(user, issue); err != nil {
return err