refactor: ignore already closed error (#1285)
* refactor: ignore already closed error This hides the `file already cloesd` error as it is distracting in the output and does not provide any value. * refactor: use go errors Co-authored-by: Casey Lee <caseypl@amazon.com>
This commit is contained in:
parent
3387fd72ee
commit
92ddcdae09
|
@ -5,6 +5,7 @@ import (
|
|||
"bufio"
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
|
@ -696,7 +697,7 @@ func (cr *containerReference) copyDir(dstPath string, srcPath string, useGitIgno
|
|||
defer func(tarFile *os.File) {
|
||||
name := tarFile.Name()
|
||||
err := tarFile.Close()
|
||||
if err != nil {
|
||||
if !errors.Is(err, os.ErrClosed) {
|
||||
logger.Error(err)
|
||||
}
|
||||
err = os.Remove(name)
|
||||
|
|
Loading…
Reference in New Issue