fix: ignore ErrClosed in deferred func
This commit is contained in:
parent
1c770b7413
commit
6b1fd647e1
|
@ -4,6 +4,7 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"io"
|
"io"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"os"
|
||||||
|
|
||||||
encjson "encoding/json"
|
encjson "encoding/json"
|
||||||
|
|
||||||
|
@ -173,7 +174,7 @@ func outputValues(ctx *cli.Context, values interface{}) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
if err := writer.Close(); err != nil {
|
if err := writer.Close(); err != nil && !errors.Is(err, os.ErrClosed) {
|
||||||
panic(errors.WithStack(err))
|
panic(errors.WithStack(err))
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
Loading…
Reference in New Issue