valueOrDefault returns the type-cast value at the specified key in the map if present and the correct type; otherwise, it returns the default value for T.
(m map[string]any, key string)
| 116 | // if present and the correct type; otherwise, it returns the default value for |
| 117 | // T. |
| 118 | func valueOrDefault[T any](m map[string]any, key string) T { |
| 119 | if v, ok := m[key].(T); ok { |
| 120 | return v |
| 121 | } |
| 122 | return *new(T) |
| 123 | } |
nothing calls this directly
no outgoing calls
no test coverage detected