chore: any -> interface{}
This commit is contained in:
parent
340239fdd9
commit
8f4132f131
6
ctx.go
6
ctx.go
@ -26,7 +26,7 @@ type Ctx struct {
|
|||||||
params map[string]string
|
params map[string]string
|
||||||
index int
|
index int
|
||||||
handlers []HandlerFunc
|
handlers []HandlerFunc
|
||||||
locals map[string]any
|
locals map[string]interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func newContext(app *App, writer http.ResponseWriter, request *http.Request) *Ctx {
|
func newContext(app *App, writer http.ResponseWriter, request *http.Request) *Ctx {
|
||||||
@ -38,12 +38,12 @@ func newContext(app *App, writer http.ResponseWriter, request *http.Request) *Ct
|
|||||||
|
|
||||||
app: app,
|
app: app,
|
||||||
index: -1,
|
index: -1,
|
||||||
locals: map[string]any{},
|
locals: map[string]interface{}{},
|
||||||
handlers: make([]HandlerFunc, 0),
|
handlers: make([]HandlerFunc, 0),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Ctx) Locals(key string, value ...any) any {
|
func (c *Ctx) Locals(key string, value ...interface{}) interface{} {
|
||||||
data := c.locals[key]
|
data := c.locals[key]
|
||||||
if len(value) > 0 {
|
if len(value) > 0 {
|
||||||
c.locals[key] = value[0]
|
c.locals[key] = value[0]
|
||||||
|
@ -50,7 +50,7 @@ func handlePost(c *nf.Ctx) error {
|
|||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
req = Req{}
|
req = Req{}
|
||||||
reqMap = make(map[string]any)
|
reqMap = make(map[string]interface{})
|
||||||
)
|
)
|
||||||
|
|
||||||
if err = c.BodyParser(&req); err != nil {
|
if err = c.BodyParser(&req); err != nil {
|
||||||
|
@ -18,7 +18,7 @@ func main() {
|
|||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
req = new(Req)
|
req = new(Req)
|
||||||
rm = make(map[string]any)
|
rm = make(map[string]interface{})
|
||||||
)
|
)
|
||||||
|
|
||||||
//if err = c.QueryParser(req); err != nil {
|
//if err = c.QueryParser(req); err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user