24 lines
327 B
Go
24 lines
327 B
Go
|
|
package sites
|
||
|
|
|
||
|
|
import (
|
||
|
|
"embed"
|
||
|
|
"strings"
|
||
|
|
"sync"
|
||
|
|
)
|
||
|
|
|
||
|
|
//go:embed tzones.txt
|
||
|
|
var tzonesFS embed.FS
|
||
|
|
|
||
|
|
var loadZones = sync.OnceValue(func() []string {
|
||
|
|
zones, err := tzonesFS.ReadFile("tzones.txt")
|
||
|
|
if err != nil {
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
return strings.Split(string(zones), "\n")
|
||
|
|
})
|
||
|
|
|
||
|
|
func ListZones() []string {
|
||
|
|
return loadZones()
|
||
|
|
}
|