diff options
Diffstat (limited to 'encode.go')
-rw-r--r-- | encode.go | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -9,8 +9,10 @@ import ( "encoding" "encoding/base64" "encoding/json" + "errors" "fmt" "io" + iofs "io/fs" "reflect" "sort" "strconv" @@ -130,7 +132,7 @@ func encode(w io.Writer, val reflect.Value, escaper BackslashEscaper, quote bool SourceFunc: "EncodeJSON", }}) } - if err := validator.Close(); err != nil { + if err := validator.Close(); err != nil && !errors.Is(err, iofs.ErrClosed) { panic(encodeError{err}) } |