1 // Copyright 2015 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
13 var platformZoneSources []string // none on iOS
15 func gorootZoneSource(goroot string) (string, bool) {
16 // The working directory at initialization is the root of the
17 // app bundle: "/private/.../bundlename.app". That's where we
18 // keep zoneinfo.zip for tethered iOS builds.
19 // For self-hosted iOS builds, the zoneinfo.zip is in GOROOT.
22 roots = append(roots, goroot+"/lib/time")
24 wd, err := syscall.Getwd()
26 roots = append(roots, wd)
28 for _, r := range roots {
30 fd, err := syscall.Open(r, syscall.O_RDONLY, 0)
34 defer syscall.Close(fd)
35 if err := syscall.Fstat(fd, &st); err == nil {
36 return r + "/zoneinfo.zip", true
43 // TODO(crawshaw): [NSTimeZone localTimeZone]