2022-06-09 23:47:12 +00:00
|
|
|
package updater
|
2021-05-08 00:59:42 +00:00
|
|
|
|
|
|
|
|
import "strings"
|
|
|
|
|
|
|
|
|
|
func codeToCountry(countryCode string, countryCodes map[string]string) (
|
2024-10-11 19:20:48 +00:00
|
|
|
country string, warning string,
|
|
|
|
|
) {
|
2021-05-08 00:59:42 +00:00
|
|
|
countryCode = strings.ToLower(countryCode)
|
|
|
|
|
country, ok := countryCodes[countryCode]
|
|
|
|
|
if !ok {
|
|
|
|
|
warning = "unknown country code: " + countryCode
|
|
|
|
|
country = countryCode
|
|
|
|
|
}
|
|
|
|
|
return country, warning
|
|
|
|
|
}
|