code: func cachedTypeFields(t reflect.Type) []field {
  	fieldCache.RLock()
  	f := fieldCache.m[t]
  	fieldCache.RUnlock()
  	if f != nil {
  		return f
  	}
  
  	// Compute fields without lock.
  	// Might duplicate effort but won't hold other computations back.
  	f = typeFields(t)
  	if f == nil {
  		f = []field{}
  	}
  
  	fieldCache.Lock()
  	if fieldCache.m == nil {
  		fieldCache.m = map[reflect.Type][]field{}
  	}
  	fieldCache.m[t] = f
  	fieldCache.Unlock()
  	return f
  }
docs: // cachedTypeFields is like typeFields but uses a cache to avoid repeated work.