Skip to content

How can I pass context.Context between pre/post-run hooks? #563

@binary132

Description

@binary132

In my pre-run hook, I'd like to set a value (someplace; maybe in the Command?) and have access to it in my Run. This seems like a good use-case for context.Context. Is this supported somehow? I was thinking of setting a Flag value, but that seems awfully hackish, and I really don't want to use a global variable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions