Source file
src/time/zoneinfo_ios.go
1
2
3
4
5
6
7 package time
8
9 import (
10 "runtime"
11 "syscall"
12 )
13
14 var zoneSources = []string{
15 getZoneRoot() + "/zoneinfo.zip",
16 }
17
18 func getZoneRoot() string {
19
20
21
22
23 roots := []string{runtime.GOROOT() + "/lib/time"}
24 wd, err := syscall.Getwd()
25 if err == nil {
26 roots = append(roots, wd)
27 }
28 for _, r := range roots {
29 var st syscall.Stat_t
30 fd, err := syscall.Open(r, syscall.O_RDONLY, 0)
31 if err != nil {
32 continue
33 }
34 defer syscall.Close(fd)
35 if err := syscall.Fstat(fd, &st); err == nil {
36 return r
37 }
38 }
39 return "/XXXNOEXIST"
40 }
41
42 func initLocal() {
43
44 localLoc = *UTC
45 }
46
View as plain text