mirror of
https://github.com/Bornholm/formidable.git
synced 2025-02-16 15:31:27 +01:00
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…
x
Reference in New Issue
Block a user