Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔥 Add a shortcut for map like gin.H #153

Closed
hyingreborn opened this issue Feb 18, 2020 · 3 comments
Closed

🔥 Add a shortcut for map like gin.H #153

hyingreborn opened this issue Feb 18, 2020 · 3 comments

Comments

@hyingreborn
Copy link

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

@hyingreborn hyingreborn changed the title 🔥 Add a shortcut for map 🔥 Add a shortcut for map like gin.H Feb 18, 2020
@Fenny
Copy link
Member

Fenny commented Feb 18, 2020

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

type Map map[string]interface{}

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

@hyingreborn
Copy link
Author

that's well

@toannguyen3105
Copy link

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

type Map map[string]interface{}

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

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants