getFieldMappings 获取字段映射缓存
(fromType, toType reflect.Type)
| 20 | |
| 21 | // getFieldMappings 获取字段映射缓存 |
| 22 | func getFieldMappings(fromType, toType reflect.Type) ([]fieldMapping, bool) { |
| 23 | key := cacheKey(fromType, toType) |
| 24 | if cached, ok := fieldMappingCache.Load(key); ok { |
| 25 | return cached.([]fieldMapping), true |
| 26 | } |
| 27 | return nil, false |
| 28 | } |
| 29 | |
| 30 | // cacheKey 生成缓存键 |
| 31 | func cacheKey(fromType, toType reflect.Type) string { |
no test coverage detected
searching dependent graphs…