Chore: use any rather than interface{} (#74066)
This commit is contained in:
+2
-2
@@ -102,7 +102,7 @@ const (
|
||||
)
|
||||
|
||||
// HTML renders the HTML with default template set.
|
||||
func (ctx *Context) HTML(status int, name string, data interface{}) {
|
||||
func (ctx *Context) HTML(status int, name string, data any) {
|
||||
ctx.Resp.Header().Set(headerContentType, contentTypeHTML)
|
||||
ctx.Resp.WriteHeader(status)
|
||||
if err := ctx.template.ExecuteTemplate(ctx.Resp, name, data); err != nil {
|
||||
@@ -113,7 +113,7 @@ func (ctx *Context) HTML(status int, name string, data interface{}) {
|
||||
}
|
||||
}
|
||||
|
||||
func (ctx *Context) JSON(status int, data interface{}) {
|
||||
func (ctx *Context) JSON(status int, data any) {
|
||||
ctx.Resp.Header().Set(headerContentType, contentTypeJSON)
|
||||
ctx.Resp.WriteHeader(status)
|
||||
enc := json.NewEncoder(ctx.Resp)
|
||||
|
||||
Reference in New Issue
Block a user