1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-09 03:57:19 +00:00

Less naked returns (#25713)

just a step towards  #25655

and some related refactoring
This commit is contained in:
6543
2023-07-07 07:31:56 +02:00
committed by GitHub
parent b1eb1676aa
commit 8995046110
32 changed files with 254 additions and 239 deletions

View File

@ -1256,20 +1256,20 @@ func registerRoutes(m *web.Route) {
m.Group("/blob_excerpt", func() {
m.Get("/{sha}", repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.ExcerptBlob)
}, func(ctx *context.Context) (cancel gocontext.CancelFunc) {
}, func(ctx *context.Context) gocontext.CancelFunc {
if ctx.FormBool("wiki") {
ctx.Data["PageIsWiki"] = true
repo.MustEnableWiki(ctx)
return
return nil
}
reqRepoCodeReader(ctx)
if ctx.Written() {
return
return nil
}
cancel = context.RepoRef()(ctx)
cancel := context.RepoRef()(ctx)
if ctx.Written() {
return
return cancel
}
repo.MustBeNotEmpty(ctx)