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 function to delete internal context.data #55

Open
byanjiong opened this issue Dec 22, 2018 · 0 comments
Open

Add function to delete internal context.data #55

byanjiong opened this issue Dec 22, 2018 · 0 comments

Comments

@byanjiong
Copy link

We use c.Set("isUser", true) to pass data to other handlers, sometimes in complex functions, we may use a few handlers inside a handler, some handlers may required some internal data to be set while other handlers do not need those data, so hope to have a function to "delete" the context.data

func abc123(c *routing.Context) error {

    c.Set("name1", true)
    err := cde123(c)

    c.Delete("name1") // <-- hope to have something like that to delete internal data
    err := cde123(c)

    return nil
}
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

1 participant