⬥ ID3 encoding/decoding library in Go ⬥
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
package util |
|
|
|
// Returns found key (int) in provided map by value (string); |
|
// If key does not exist in map - returns -1 |
|
func GetKey(mp map[int]string, givenValue string) int { |
|
for key, value := range mp { |
|
if value == givenValue { |
|
return key |
|
} |
|
} |
|
return -1 |
|
}
|
|
|