mirror of
https://github.com/1f349/lotus.git
synced 2024-12-23 00:24:17 +00:00
10 lines
162 B
Go
10 lines
162 B
Go
package utils
|
|
|
|
func MapKeys[M ~map[K]any, K comparable](src M) []K {
|
|
dst := make([]K, 0, len(src))
|
|
for k := range src {
|
|
dst = append(dst, k)
|
|
}
|
|
return dst
|
|
}
|