From 8f4132f131f1921b0d20268d013ae0496beaa50d Mon Sep 17 00:00:00 2001 From: loveuer Date: Sat, 13 Jan 2024 20:44:20 +0800 Subject: [PATCH] chore: any -> interface{} --- ctx.go | 6 +++--- readme.md | 2 +- xtest/queryParser/main.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ctx.go b/ctx.go index 9a2dbed..2d3a666 100644 --- a/ctx.go +++ b/ctx.go @@ -26,7 +26,7 @@ type Ctx struct { params map[string]string index int handlers []HandlerFunc - locals map[string]any + locals map[string]interface{} } 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, index: -1, - locals: map[string]any{}, + locals: map[string]interface{}{}, 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] if len(value) > 0 { c.locals[key] = value[0] diff --git a/readme.md b/readme.md index 3142e52..09fbd07 100644 --- a/readme.md +++ b/readme.md @@ -50,7 +50,7 @@ func handlePost(c *nf.Ctx) error { var ( err error req = Req{} - reqMap = make(map[string]any) + reqMap = make(map[string]interface{}) ) if err = c.BodyParser(&req); err != nil { diff --git a/xtest/queryParser/main.go b/xtest/queryParser/main.go index 20769fa..1c61f2d 100644 --- a/xtest/queryParser/main.go +++ b/xtest/queryParser/main.go @@ -18,7 +18,7 @@ func main() { var ( err error req = new(Req) - rm = make(map[string]any) + rm = make(map[string]interface{}) ) //if err = c.QueryParser(req); err != nil {