Cache stores a value in the cache.
( _ context.Context, key K, in V, )
| 54 | continue |
| 55 | } |
| 56 | newInner := make(map[K2]V, len(inner)) |
| 57 | maps.Copy(newInner, inner) |
| 58 | out[k] = newInner |
| 59 | } |
| 60 | |
| 61 | return out |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | // LocalDataCache is an in-memory thread safe cache. |
| 66 | // It uses generics so that users of it can uses any type of data they want. |
| 67 | // The key K must be of type comparable. More infomration here: https://go.dev/blog/comparable |
| 68 | // The value V can be any type. |
| 69 | type LocalDataCache[K comparable, V any] struct { |
nothing calls this directly
no outgoing calls
no test coverage detected