remove multierr dependency
This commit is contained in:
parent
9ca0d8019c
commit
861f0d319a
@ -11,8 +11,6 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"go.uber.org/multierr"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -142,7 +140,12 @@ func Flatten(rd io.ReadSeeker, w io.Writer) (err error) {
|
|||||||
|
|
||||||
tw := tar.NewWriter(w)
|
tw := tar.NewWriter(w)
|
||||||
defer func() {
|
defer func() {
|
||||||
err = multierr.Append(err, tw.Close())
|
// Avoiding use of multierr: if error is present, return
|
||||||
|
// that. Otherwise return whatever `Close` returns.
|
||||||
|
err1 := tw.Close()
|
||||||
|
if err == nil {
|
||||||
|
err = err1
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
// iterate through all layers, all files, and write files.
|
// iterate through all layers, all files, and write files.
|
||||||
for i, no := range layers {
|
for i, no := range layers {
|
||||||
|
Loading…
Reference in New Issue
Block a user