Documentation
¶
Index ¶
- func ExitWithCode(err error)
- func PostRunWithCtxE(run func(ctx context.Context, cmd *cobra.Command, args []string) error) func(cmd *cobra.Command, args []string) error
- func RunWithCtx(run func(ctx context.Context, cmd *cobra.Command, args []string) error) func(cmd *cobra.Command, args []string)
- type ErrorWithCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExitWithCode ¶
func ExitWithCode(err error)
ExitWithCode will exit the program with a error code if provided, else 1
Types ¶
type ErrorWithCode ¶
type ErrorWithCode struct {
Code int
}
ErrorWithCode is an error that contains an os.Exit code
func NewErrorWithCode ¶
func NewErrorWithCode(code int) *ErrorWithCode
NewErrorWithCode will return a new error with an os.Exit code
func (ErrorWithCode) Error ¶
func (ewc ErrorWithCode) Error() string
Click to show internal directories.
Click to hide internal directories.