Source file
src/time/zoneinfo_ios.go
1
2
3
4
5
6
7 package time
8
9 import (
10 "syscall"
11 )
12
13 var platformZoneSources []string
14
15 func gorootZoneSource(goroot string) (string, bool) {
16
17
18
19
20 var roots []string
21 if goroot != "" {
22 roots = append(roots, goroot+"/lib/time")
23 }
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 + "/zoneinfo.zip", true
37 }
38 }
39 return "", false
40 }
41
42 func initLocal() {
43
44 localLoc = *UTC
45 }
46
View as plain text