Codebase list golang-github-containers-buildah / 8c18a2e
chroot/run.go: check errors in deferred calls Reported by golangci-lint. Signed-off-by: Valentin Rothberg <rothberg@redhat.com> Closes: #1624 Approved by: TomSweeneyRedHat Valentin Rothberg authored 4 years ago Atomic Bot committed 4 years ago
1 changed file(s) with 6 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
506506 return 1, err
507507 }
508508 defer func() {
509 undoIntermediates()
509 if undoErr := undoIntermediates(); undoErr != nil {
510 err = errors.Wrap(err, undoErr.Error())
511 }
510512 }()
511513
512514 // Bind mount in our filesystems.
515517 return 1, err
516518 }
517519 defer func() {
518 undoChroots()
520 if undoErr := undoChroots(); undoErr != nil {
521 err = errors.Wrap(err, undoErr.Error())
522 }
519523 }()
520524
521525 // Create a pipe for passing configuration down to the next process.