Keys creates an array of the map keys.
(in map[K]V)
| 4 | |
| 5 | // Keys creates an array of the map keys. |
| 6 | func Keys[K comparable, V any](in map[K]V) []K { |
| 7 | result := make([]K, 0, len(in)) |
| 8 | |
| 9 | for k := range in { |
| 10 | result = append(result, k) |
| 11 | } |
| 12 | |
| 13 | return result |
| 14 | } |
| 15 | |
| 16 | // Values creates an array of the map values. |
| 17 | func Values[K comparable, V any](in map[K]V) []V { |
no outgoing calls
searching dependent graphs…