]>
Commit | Line | Data |
---|---|---|
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. | |
3 | diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go | |
4 | index 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" |