chore: any -> interface{}

This commit is contained in:
loveuer 2024-01-13 20:44:20 +08:00
parent 340239fdd9
commit 8f4132f131
3 changed files with 5 additions and 5 deletions
ctx.goreadme.md
xtest/queryParser

6
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]

@ -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 {

@ -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 {