This commit is contained in:
Andrey Parhomenko 2023-07-28 20:48:02 +03:00
parent 0f08d096f6
commit 877ee12549

10
src/mapx/misc.go Normal file
View file

@ -0,0 +1,10 @@
package mapx
func Reversed[K, V comparable](m map[K] V) map[V] K {
r := make(map[V] K)
for k, v := range m {
r[v] = k
}
return r
}