1
Fork 0

nit: shorter defer body

main
Motiejus Jakštys 2021-08-29 18:39:43 +03:00 committed by Motiejus Jakštys
parent cca579d218
commit f02af98ac5
1 changed files with 2 additions and 3 deletions

View File

@ -153,9 +153,8 @@ func Flatten(rd io.ReadSeeker, w io.Writer, opts ...Option) (_err error) {
defer func() { defer func() {
// Avoiding use of multierr: if error is present, return // Avoiding use of multierr: if error is present, return
// that. Otherwise return whatever `Close` returns. // that. Otherwise return whatever `Close` returns.
err1 := tw.Close() if err := tw.Close(); err != nil && _err == nil {
if _err == nil { _err = err
_err = err1
} }
}() }()
// iterate through all layers, all files, and write files. // iterate through all layers, all files, and write files.