@@ -97,22 +97,22 @@ type Context interface {
9797 Cookies () []* http.Cookie
9898
9999 // Get retrieves data from the context.
100- Get (key string ) interface {}
100+ Get (key string ) any
101101
102102 // Set saves data in the context.
103- Set (key string , val interface {} )
103+ Set (key string , val any )
104104
105105 // Bind binds path params, query params and the request body into provided type `i`. The default binder
106106 // binds body based on Content-Type header.
107- Bind (i interface {} ) error
107+ Bind (i any ) error
108108
109109 // Validate validates provided `i`. It is usually called after `Context#Bind()`.
110110 // Validator must be registered using `Echo#Validator`.
111- Validate (i interface {} ) error
111+ Validate (i any ) error
112112
113113 // Render renders a template with data and sends a text/html response with status
114114 // code. Renderer must be registered using `Echo.Renderer`.
115- Render (code int , name string , data interface {} ) error
115+ Render (code int , name string , data any ) error
116116
117117 // HTML sends an HTTP response with status code.
118118 HTML (code int , html string ) error
@@ -124,27 +124,27 @@ type Context interface {
124124 String (code int , s string ) error
125125
126126 // JSON sends a JSON response with status code.
127- JSON (code int , i interface {} ) error
127+ JSON (code int , i any ) error
128128
129129 // JSONPretty sends a pretty-print JSON with status code.
130- JSONPretty (code int , i interface {} , indent string ) error
130+ JSONPretty (code int , i any , indent string ) error
131131
132132 // JSONBlob sends a JSON blob response with status code.
133133 JSONBlob (code int , b []byte ) error
134134
135135 // JSONP sends a JSONP response with status code. It uses `callback` to construct
136136 // the JSONP payload.
137- JSONP (code int , callback string , i interface {} ) error
137+ JSONP (code int , callback string , i any ) error
138138
139139 // JSONPBlob sends a JSONP blob response with status code. It uses `callback`
140140 // to construct the JSONP payload.
141141 JSONPBlob (code int , callback string , b []byte ) error
142142
143143 // XML sends an XML response with status code.
144- XML (code int , i interface {} ) error
144+ XML (code int , i any ) error
145145
146146 // XMLPretty sends a pretty-print XML with status code.
147- XMLPretty (code int , i interface {} , indent string ) error
147+ XMLPretty (code int , i any , indent string ) error
148148
149149 // XMLBlob sends an XML blob response with status code.
150150 XMLBlob (code int , b []byte ) error
@@ -430,13 +430,13 @@ func (c *context) Cookies() []*http.Cookie {
430430 return c .request .Cookies ()
431431}
432432
433- func (c * context ) Get (key string ) interface {} {
433+ func (c * context ) Get (key string ) any {
434434 c .lock .RLock ()
435435 defer c .lock .RUnlock ()
436436 return c .store [key ]
437437}
438438
439- func (c * context ) Set (key string , val interface {} ) {
439+ func (c * context ) Set (key string , val any ) {
440440 c .lock .Lock ()
441441 defer c .lock .Unlock ()
442442
@@ -446,18 +446,18 @@ func (c *context) Set(key string, val interface{}) {
446446 c .store [key ] = val
447447}
448448
449- func (c * context ) Bind (i interface {} ) error {
449+ func (c * context ) Bind (i any ) error {
450450 return c .echo .Binder .Bind (i , c )
451451}
452452
453- func (c * context ) Validate (i interface {} ) error {
453+ func (c * context ) Validate (i any ) error {
454454 if c .echo .Validator == nil {
455455 return ErrValidatorNotRegistered
456456 }
457457 return c .echo .Validator .Validate (i )
458458}
459459
460- func (c * context ) Render (code int , name string , data interface {} ) (err error ) {
460+ func (c * context ) Render (code int , name string , data any ) (err error ) {
461461 if c .echo .Renderer == nil {
462462 return ErrRendererNotRegistered
463463 }
@@ -480,7 +480,7 @@ func (c *context) String(code int, s string) (err error) {
480480 return c .Blob (code , MIMETextPlainCharsetUTF8 , []byte (s ))
481481}
482482
483- func (c * context ) jsonPBlob (code int , callback string , i interface {} ) (err error ) {
483+ func (c * context ) jsonPBlob (code int , callback string , i any ) (err error ) {
484484 indent := ""
485485 if _ , pretty := c .QueryParams ()["pretty" ]; c .echo .Debug || pretty {
486486 indent = defaultIndent
@@ -499,29 +499,29 @@ func (c *context) jsonPBlob(code int, callback string, i interface{}) (err error
499499 return
500500}
501501
502- func (c * context ) json (code int , i interface {} , indent string ) error {
502+ func (c * context ) json (code int , i any , indent string ) error {
503503 c .writeContentType (MIMEApplicationJSON )
504504 c .response .Status = code
505505 return c .echo .JSONSerializer .Serialize (c , i , indent )
506506}
507507
508- func (c * context ) JSON (code int , i interface {} ) (err error ) {
508+ func (c * context ) JSON (code int , i any ) (err error ) {
509509 indent := ""
510510 if _ , pretty := c .QueryParams ()["pretty" ]; c .echo .Debug || pretty {
511511 indent = defaultIndent
512512 }
513513 return c .json (code , i , indent )
514514}
515515
516- func (c * context ) JSONPretty (code int , i interface {} , indent string ) (err error ) {
516+ func (c * context ) JSONPretty (code int , i any , indent string ) (err error ) {
517517 return c .json (code , i , indent )
518518}
519519
520520func (c * context ) JSONBlob (code int , b []byte ) (err error ) {
521521 return c .Blob (code , MIMEApplicationJSON , b )
522522}
523523
524- func (c * context ) JSONP (code int , callback string , i interface {} ) (err error ) {
524+ func (c * context ) JSONP (code int , callback string , i any ) (err error ) {
525525 return c .jsonPBlob (code , callback , i )
526526}
527527
@@ -538,7 +538,7 @@ func (c *context) JSONPBlob(code int, callback string, b []byte) (err error) {
538538 return
539539}
540540
541- func (c * context ) xml (code int , i interface {} , indent string ) (err error ) {
541+ func (c * context ) xml (code int , i any , indent string ) (err error ) {
542542 c .writeContentType (MIMEApplicationXMLCharsetUTF8 )
543543 c .response .WriteHeader (code )
544544 enc := xml .NewEncoder (c .response )
@@ -551,15 +551,15 @@ func (c *context) xml(code int, i interface{}, indent string) (err error) {
551551 return enc .Encode (i )
552552}
553553
554- func (c * context ) XML (code int , i interface {} ) (err error ) {
554+ func (c * context ) XML (code int , i any ) (err error ) {
555555 indent := ""
556556 if _ , pretty := c .QueryParams ()["pretty" ]; c .echo .Debug || pretty {
557557 indent = defaultIndent
558558 }
559559 return c .xml (code , i , indent )
560560}
561561
562- func (c * context ) XMLPretty (code int , i interface {} , indent string ) (err error ) {
562+ func (c * context ) XMLPretty (code int , i any , indent string ) (err error ) {
563563 return c .xml (code , i , indent )
564564}
565565
0 commit comments