nit: shorter defer body
This commit is contained in:
parent
cca579d218
commit
f02af98ac5
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user