goext/langext/maps.go

10 lines
171 B
Go
Raw Normal View History

2022-10-27 16:48:26 +02:00
package langext
func MapKeyArr[T comparable, V any](v map[T]V) []T {
result := make([]T, 0, len(v))
for k := range v {
result = append(result, k)
}
return result
}