Skip to content

Prefer RunE over Run for Cobra commands #57

Description

@jnschaeffer

Is your feature request related to a problem? Please describe.
Cobra Command structs can use either the Run or RunE fields to run actual commands. Using RunE for commands rather than Run allows us to return errors when commands fail, which can be nicer to work with than using logger.Fatal.

Describe the solution you'd like
All commands that are populated with Run set are populated with RunE set instead.

Describe alternatives you've considered
We can leave things as they are, but it makes commands harder to read and test.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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