map[reflect.Type]structFields cachedTypeFields is like typeFields but uses a cache to avoid repeated work.
(t reflect.Type)
| 1390 | |
| 1391 | // cachedTypeFields is like typeFields but uses a cache to avoid repeated work. |
| 1392 | func 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 | |
| 1400 | func mayAppendQuote(b []byte, quoted bool) []byte { |
| 1401 | if quoted { |
no test coverage detected
searching dependent graphs…