- 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
21 lines
262 B
Go
21 lines
262 B
Go
package updater
|
|
|
|
import (
|
|
"strings"
|
|
"unicode"
|
|
)
|
|
|
|
func parseFilename(fileName string) (city string) {
|
|
const suffix = ".conf"
|
|
s := strings.TrimSuffix(fileName, suffix)
|
|
|
|
for i, r := range s {
|
|
if unicode.IsDigit(r) {
|
|
s = s[:i]
|
|
break
|
|
}
|
|
}
|
|
|
|
return s
|
|
}
|