(stdout, stderr string, ignoreExist1 bool, err error)
| 485 | } |
| 486 | |
| 487 | func handleErrString(stdout, stderr string, ignoreExist1 bool, err error) (string, error) { |
| 488 | var exitError *exec.ExitError |
| 489 | if ignoreExist1 && errors.As(err, &exitError) { |
| 490 | if status, ok := exitError.Sys().(syscall.WaitStatus); ok { |
| 491 | if status.ExitStatus() == 1 { |
| 492 | return "", nil |
| 493 | } |
| 494 | } |
| 495 | } |
| 496 | outItem := stdout |
| 497 | errItem := stderr |
| 498 | if len(errItem) != 0 && len(outItem) != 0 { |
| 499 | return outItem, fmt.Errorf("stdout: %s; stderr: %s, err: %v", outItem, errItem, err) |
| 500 | } |
| 501 | if len(errItem) != 0 { |
| 502 | return outItem, fmt.Errorf("stderr: %s, err: %v", errItem, err) |
| 503 | } |
| 504 | if len(outItem) != 0 { |
| 505 | return outItem, fmt.Errorf("stdout: %s, err: %v", outItem, err) |
| 506 | } |
| 507 | return "", err |
| 508 | } |
no test coverage detected