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
1 changed files with 2 additions and 1 deletions
|
@ -5,6 +5,7 @@ import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
@ -696,7 +697,7 @@ func (cr *containerReference) copyDir(dstPath string, srcPath string, useGitIgno
|
||||||
defer func(tarFile *os.File) {
|
defer func(tarFile *os.File) {
|
||||||
name := tarFile.Name()
|
name := tarFile.Name()
|
||||||
err := tarFile.Close()
|
err := tarFile.Close()
|
||||||
if err != nil {
|
if !errors.Is(err, os.ErrClosed) {
|
||||||
logger.Error(err)
|
logger.Error(err)
|
||||||
}
|
}
|
||||||
err = os.Remove(name)
|
err = os.Remove(name)
|
||||||
|
|
Loading…
Reference in a new issue