bskyweb: minor 'go fix' style changes
This commit is contained in:
@@ -54,7 +54,7 @@ func NewRenderer(prefix string, fs *embed.FS, debug bool) *Renderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r Renderer) Render(w io.Writer, name string, data interface{}, c echo.Context) error {
|
func (r Renderer) Render(w io.Writer, name string, data any, c echo.Context) error {
|
||||||
var ctx pongo2.Context
|
var ctx pongo2.Context
|
||||||
|
|
||||||
if data != nil {
|
if data != nil {
|
||||||
|
|||||||
@@ -11,6 +11,6 @@ type Template struct {
|
|||||||
templates *template.Template
|
templates *template.Template
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Template) Render(w io.Writer, name string, data interface{}, c echo.Context) error {
|
func (t *Template) Render(w io.Writer, name string, data any, c echo.Context) error {
|
||||||
return t.templates.ExecuteTemplate(w, name, data)
|
return t.templates.ExecuteTemplate(w, name, data)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -180,9 +180,9 @@ func serve(cctx *cli.Context) error {
|
|||||||
|
|
||||||
// Create CORS middleware for oembed
|
// Create CORS middleware for oembed
|
||||||
oembedCORS := middleware.CORSWithConfig(middleware.CORSConfig{
|
oembedCORS := middleware.CORSWithConfig(middleware.CORSConfig{
|
||||||
AllowOrigins: []string{"*"},
|
AllowOrigins: []string{"*"},
|
||||||
AllowMethods: []string{http.MethodGet, http.MethodHead, http.MethodOptions},
|
AllowMethods: []string{http.MethodGet, http.MethodHead, http.MethodOptions},
|
||||||
AllowHeaders: []string{"Origin", "Content-Type", "Accept"},
|
AllowHeaders: []string{"Origin", "Content-Type", "Accept"},
|
||||||
})
|
})
|
||||||
|
|
||||||
e.GET("/robots.txt", echo.WrapHandler(staticHandler))
|
e.GET("/robots.txt", echo.WrapHandler(staticHandler))
|
||||||
@@ -271,7 +271,7 @@ func (srv *Server) errorHandler(err error, c echo.Context) {
|
|||||||
code = he.Code
|
code = he.Code
|
||||||
}
|
}
|
||||||
c.Logger().Error(err)
|
c.Logger().Error(err)
|
||||||
data := map[string]interface{}{
|
data := map[string]any{
|
||||||
"statusCode": code,
|
"statusCode": code,
|
||||||
}
|
}
|
||||||
c.Render(code, "error.html", data)
|
c.Render(code, "error.html", data)
|
||||||
|
|||||||
Reference in New Issue
Block a user