]> git.pld-linux.org Git - packages/golang.git/blame - go1.5-zoneinfo_testing_only.patch
up to 1.9.3
[packages/golang.git] / go1.5-zoneinfo_testing_only.patch
CommitLineData
c1200160
ER
1# we had been just removing the zoneinfo.zip, but that caused tests to fail for users that
2# later run `go test -a std`. This makes it only use the zoneinfo.zip where needed in tests.
3diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go
4index ed9502d..c2569e7 100644
5--- a/src/time/zoneinfo_unix.go
6+++ b/src/time/zoneinfo_unix.go
7@@ -32,14 +32,14 @@ var zoneDirs = []string{
8 "/usr/share/zoneinfo/",
9 "/usr/share/lib/zoneinfo/",
10 "/usr/lib/locale/TZ/",
11- runtime.GOROOT() + "/lib/time/zoneinfo.zip",
12 }
13
14 var origZoneDirs = zoneDirs
15
16 func forceZipFileForTesting(zipOnly bool) {
17- zoneDirs = make([]string, len(origZoneDirs))
18+ zoneDirs = make([]string, len(origZoneDirs)+1)
19 copy(zoneDirs, origZoneDirs)
20+ zoneDirs = append(zoneDirs, runtime.GOROOT()+"/lib/time/zoneinfo.zip")
21 if zipOnly {
22 for i := 0; i < len(zoneDirs)-1; i++ {
23 zoneDirs[i] = "/XXXNOEXIST"
This page took 0.035864 seconds and 4 git commands to generate.