go/src/log/slog/value_access_benchmark_test.go

// The "As" form is the slowest.
// The switch-panic and visitor times are almost the same.
// BenchmarkDispatch/switch-checked-8         	 8669427	       137.7 ns/op
// BenchmarkDispatch/As-8                     	 8212087	       145.3 ns/op
// BenchmarkDispatch/Visit-8                  	 8926146	       135.3 ns/op
func BenchmarkDispatch(b *testing.B) {}

type setVisitor

func (v *setVisitor) String(s string)          {}

func (v *setVisitor) Int64(i int64)            {}

func (v *setVisitor) Uint64(x uint64)          {}

func (v *setVisitor) Float64(x float64)        {}

func (v *setVisitor) Bool(x bool)              {}

func (v *setVisitor) Duration(x time.Duration) {}

func (v *setVisitor) Any(x any)                {}

func (a Value) AsString() (string, bool) {}

func (a Value) AsInt64() (int64, bool) {}

func (a Value) AsUint64() (uint64, bool) {}

func (a Value) AsFloat64() (float64, bool) {}

func (a Value) AsBool() (bool, bool) {}

func (a Value) AsDuration() (time.Duration, bool) {}

func (a Value) AsAny() (any, bool) {}

type Visitor

func (a Value) Visit(v Visitor) {}