- Each provider interface can now fetch updated servers data - Rename each provider updater subpackage name to `updater` - Updater constructor does not take a settings struct - Updater update method takes in a slice of provider strings
15 lines
344 B
Go
15 lines
344 B
Go
package updater
|
|
|
|
import "strings"
|
|
|
|
func codeToCountry(countryCode string, countryCodes map[string]string) (
|
|
country string, warning string) {
|
|
countryCode = strings.ToLower(countryCode)
|
|
country, ok := countryCodes[countryCode]
|
|
if !ok {
|
|
warning = "unknown country code: " + countryCode
|
|
country = countryCode
|
|
}
|
|
return country, warning
|
|
}
|