Invert¶
func Invert[K, V comparable](mapInstance map[K]V) map[V]K
Invert swaps keys and values in a map. Both keys and values must be comparable types. If multiple keys have the same value, only one will remain (non-deterministic which one).
func Invert[K, V comparable](mapInstance map[K]V) map[V]K
Invert swaps keys and values in a map. Both keys and values must be comparable types. If multiple keys have the same value, only one will remain (non-deterministic which one).