CheckArgs should be used to ensure the right command line arguments are passed before executing an example.
(arg ...string)
| 9 | // CheckArgs should be used to ensure the right command line arguments are |
| 10 | // passed before executing an example. |
| 11 | func CheckArgs(arg ...string) { |
| 12 | if len(os.Args) < len(arg)+1 { |
| 13 | Warning("Usage: %s %s", os.Args[0], strings.Join(arg, " ")) |
| 14 | os.Exit(1) |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | // CheckIfError should be used to naively panics if an error is not nil. |
| 19 | func CheckIfError(err error) { |
no test coverage detected
searching dependent graphs…