(err error)
| 697 | } |
| 698 | |
| 699 | func GetExitCode(err error) int { |
| 700 | if err == nil { |
| 701 | return 0 |
| 702 | } |
| 703 | if exitErr, ok := err.(*exec.ExitError); ok { |
| 704 | return exitErr.ExitCode() |
| 705 | } else { |
| 706 | return -1 |
| 707 | } |
| 708 | } |
| 709 | |
| 710 | func GetFirstLine(s string) string { |
| 711 | idx := strings.Index(s, "\n") |
no test coverage detected