Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultErrorExitCode = 1
)
Variables ¶
View Source
var ErrExit = fmt.Errorf("exit")
ErrExit may be passed to CheckError to instruct it to output nothing but exit with status code 1.
Functions ¶
func CheckErr ¶
func CheckErr(err error)
CheckErr prints a user friendly error to STDERR and exits with a non-zero exit code. Unrecognized errors will be printed with an "error: " prefix.
This method is generic to the command in use and may be used by non-Kubectl commands.
Example:
func main() { cmd := NewRootCommand() if err := cmd.Execute(); err != nil { cmdutil.CheckErr(err) } }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.