MCPcopy
hub / github.com/openai/openai-go / cachedTypeFields

Function cachedTypeFields

internal/encoding/json/encode.go:1392–1398  ·  view source on GitHub ↗

map[reflect.Type]structFields cachedTypeFields is like typeFields but uses a cache to avoid repeated work.

(t reflect.Type)

Source from the content-addressed store, hash-verified

1390
1391// cachedTypeFields is like typeFields but uses a cache to avoid repeated work.
1392func cachedTypeFields(t reflect.Type) structFields {
1393 if f, ok := fieldCache.Load(t); ok {
1394 return f.(structFields)
1395 }
1396 f, _ := fieldCache.LoadOrStore(t, typeFields(t))
1397 return f.(structFields)
1398}
1399
1400func mayAppendQuote(b []byte, quoted bool) []byte {
1401 if quoted {

Callers 2

newStructEncoderFunction · 0.85
objectMethod · 0.85

Calls 1

typeFieldsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…