This commit is contained in:
parent
97d4b9b4a1
commit
c73e50a091
9
momap/rev.go
Normal file
9
momap/rev.go
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
package momap
|
||||||
|
|
||||||
|
func ReverseMap[K, V comparable](m map[K]V) map[V]K {
|
||||||
|
revMap := make(map[V]K)
|
||||||
|
for k, v := range m {
|
||||||
|
revMap[v] = k
|
||||||
|
}
|
||||||
|
return revMap
|
||||||
|
}
|
Loading…
Reference in a new issue