MCPcopy
hub / github.com/uber-go/zap / Any

Method Any

field.go:477–481  ·  view source on GitHub ↗
(key string, val any)

Source from the content-addressed store, hash-verified

475type anyFieldC[T any] func(string, T) Field
476
477func (f anyFieldC[T]) Any(key string, val any) Field {
478 v, _ := val.(T)
479 // val is guaranteed to be a T, except when it's nil.
480 return f(key, v)
481}
482
483// Any takes a key and an arbitrary value and chooses the best way to represent
484// them as a field, falling back to a reflection-based approach only if

Callers 4

AnyFunction · 0.80
convertAttrToFieldFunction · 0.80
Example_slogFunction · 0.80
fakeSlogFieldsFunction · 0.80

Calls

no outgoing calls

Tested by 2

Example_slogFunction · 0.64
fakeSlogFieldsFunction · 0.64