CheckIfError should be used to naively panics if an error is not nil.
(err error)
| 673 | |
| 674 | // CheckIfError should be used to naively panics if an error is not nil. |
| 675 | func CheckIfError(err error) { |
| 676 | if err == nil { |
| 677 | return |
| 678 | } |
| 679 | |
| 680 | fmt.Printf("\x1b[31;1m%s\x1b[0m\n", fmt.Sprintf("error: %s", err)) |
| 681 | os.Exit(1) |
| 682 | } |
| 683 | |
| 684 | // Info should be used to describe the example commands that are about to run. |
| 685 | func Info(format string, args ...interface{}) { |