mirror of
https://github.com/gogs/gogs.git
synced 2026-02-27 16:50:58 +01:00
style: format code with Go fmt and Gofumpt
This commit fixes the style issues introduced in de467e5 according to the output
from Go fmt and Gofumpt.
Details: https://github.com/gogs/gogs/pull/8111
This commit is contained in:
committed by
GitHub
parent
de467e5d69
commit
1bd867ab15
@@ -147,7 +147,7 @@ func newFlamego() *flamego.Flame {
|
||||
f.Use(captcha.Captchaer(captcha.Options{
|
||||
URLPrefix: conf.Server.Subpath,
|
||||
}))
|
||||
|
||||
|
||||
// Custom health check endpoint (replaces toolbox)
|
||||
f.Get("/-/healthz", func(w http.ResponseWriter) {
|
||||
if err := database.Ping(); err != nil {
|
||||
@@ -158,7 +158,7 @@ func newFlamego() *flamego.Flame {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
fmt.Fprint(w, "ok")
|
||||
})
|
||||
|
||||
|
||||
return f
|
||||
}
|
||||
|
||||
@@ -172,23 +172,23 @@ func runWeb(c *cli.Context) error {
|
||||
|
||||
// Apply global middleware
|
||||
f.Use(session.Sessioner(session.Options{
|
||||
Provider: conf.Session.Provider,
|
||||
Config: conf.Session.ProviderConfig,
|
||||
CookieName: conf.Session.CookieName,
|
||||
CookiePath: conf.Server.Subpath,
|
||||
Gclifetime: conf.Session.GCInterval,
|
||||
Provider: conf.Session.Provider,
|
||||
Config: conf.Session.ProviderConfig,
|
||||
CookieName: conf.Session.CookieName,
|
||||
CookiePath: conf.Server.Subpath,
|
||||
Gclifetime: conf.Session.GCInterval,
|
||||
Maxlifetime: conf.Session.MaxLifeTime,
|
||||
Secure: conf.Session.CookieSecure,
|
||||
Secure: conf.Session.CookieSecure,
|
||||
}))
|
||||
f.Use(csrf.Csrfer(csrf.Options{
|
||||
Secret: conf.Security.SecretKey,
|
||||
Header: "X-CSRF-Token",
|
||||
Cookie: conf.Session.CSRFCookieName,
|
||||
Domain: conf.Server.URL.Hostname(),
|
||||
Path: conf.Server.Subpath,
|
||||
HTTPOnly: true,
|
||||
SetCookie: true,
|
||||
Secure: conf.Server.URL.Scheme == "https",
|
||||
Secret: conf.Security.SecretKey,
|
||||
Header: "X-CSRF-Token",
|
||||
Cookie: conf.Session.CSRFCookieName,
|
||||
Domain: conf.Server.URL.Hostname(),
|
||||
Path: conf.Server.Subpath,
|
||||
HTTPOnly: true,
|
||||
SetCookie: true,
|
||||
Secure: conf.Server.URL.Scheme == "https",
|
||||
}))
|
||||
f.Use(context.Contexter(context.NewStore()))
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ func authenticatedUserID(store AuthStore, c flamego.Context, sess session.Sessio
|
||||
if !database.HasEngine {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
|
||||
req := c.Request()
|
||||
|
||||
// Check access token.
|
||||
@@ -204,7 +204,7 @@ func authenticatedUser(store AuthStore, ctx flamego.Context, sess session.Sessio
|
||||
}
|
||||
|
||||
uid, isTokenAuth := authenticatedUserID(store, ctx, sess)
|
||||
|
||||
|
||||
req := ctx.Request()
|
||||
|
||||
if uid <= 0 {
|
||||
|
||||
@@ -36,7 +36,7 @@ type Context struct {
|
||||
ResponseWriter http.ResponseWriter
|
||||
Request *http.Request
|
||||
Data template.Data
|
||||
|
||||
|
||||
Link string // Current request URL
|
||||
User *database.User
|
||||
IsLogged bool
|
||||
|
||||
Reference in New Issue
Block a user