Fiber: 馃敟 Add a shortcut for map like gin.H

Created on 18 Feb 2020  路  2Comments  路  Source: gofiber/fiber

Is your feature request related to a problem?
No

Describe the solution you'd like

c.JSON(fiber.H{
    "field1": someStructData1,
    "field2": someStructData2,
})
// H is a shortcut for map[string]interface{}
type H map[string]interface{}

Describe alternatives you've considered

Additional context

Most helpful comment

This can be added in v2, what about naming it Map ?

type Map map[string]interface{}

c.JSON(fiber.Map{
    "field1": someStructData1,
    "field2": someStructData2,
})

All 2 comments

This can be added in v2, what about naming it Map ?

type Map map[string]interface{}

c.JSON(fiber.Map{
    "field1": someStructData1,
    "field2": someStructData2,
})

that's well

Was this page helpful?
0 / 5 - 0 ratings