refactor Context to CTX and add context parameter to complains custom contexts from styleguide

This commit is contained in:
2024-11-20 23:07:55 +01:00
parent 8a0e99651c
commit 4c8c6121b1
4 changed files with 28 additions and 28 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ import (
"time"
)
func (c *Context) BindJSON(v any) error {
func (c *CTX) BindJSON(v any) error {
if c.R.Header.Get("Content-Type") != "application/json" {
return http.ErrNotSupported
}
@@ -18,7 +18,7 @@ func (c *Context) BindJSON(v any) error {
return decoder.Decode(v)
}
func (c *Context) BindForm(v interface{}) error {
func (c *CTX) BindForm(v interface{}) error {
if err := c.R.ParseForm(); err != nil {
return err
}