update dependencies

This commit is contained in:
Mechiel Lukkien
2024-01-05 11:12:24 +01:00
parent 0f8bf2f220
commit 62db2af846
73 changed files with 1112 additions and 747 deletions

View File

@ -8,6 +8,7 @@ import (
"context"
"fmt"
"io"
"reflect"
"strconv"
"sync"
"time"
@ -504,6 +505,23 @@ func (s *handleState) appendString(str string) {
}
func (s *handleState) appendValue(v Value) {
defer func() {
if r := recover(); r != nil {
// If it panics with a nil pointer, the most likely cases are
// an encoding.TextMarshaler or error fails to guard against nil,
// in which case "<nil>" seems to be the feasible choice.
//
// Adapted from the code in fmt/print.go.
if v := reflect.ValueOf(v.any); v.Kind() == reflect.Pointer && v.IsNil() {
s.appendString("<nil>")
return
}
// Otherwise just print the original panic message.
s.appendString(fmt.Sprintf("!PANIC: %v", r))
}
}()
var err error
if s.h.json {
err = appendJSONValue(s, v)