chore(all): move sub-packages to internal/provider
This commit is contained in:
20
internal/provider/perfectprivacy/updater/filename.go
Normal file
20
internal/provider/perfectprivacy/updater/filename.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package perfectprivacy
|
||||
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user