Skip to content

Add function to delete internal context.data #55

@byanjiong

Description

@byanjiong

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions