|
|
034e53 |
diff -up go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/internal_test.go.time go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/internal_test.go
|
|
|
034e53 |
--- go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/internal_test.go.time 2017-12-05 01:10:10.000000000 +0100
|
|
|
034e53 |
+++ go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/internal_test.go 2017-12-05 14:55:10.574637475 +0100
|
|
|
034e53 |
@@ -4,13 +4,15 @@
|
|
|
034e53 |
|
|
|
034e53 |
package time
|
|
|
034e53 |
|
|
|
034e53 |
+import "runtime"
|
|
|
034e53 |
+
|
|
|
034e53 |
func init() {
|
|
|
034e53 |
// force US/Pacific for time zone tests
|
|
|
034e53 |
ForceUSPacificForTesting()
|
|
|
034e53 |
}
|
|
|
034e53 |
|
|
|
034e53 |
func initTestingZone() {
|
|
|
034e53 |
- z, err := loadLocation("America/Los_Angeles", zoneSources[len(zoneSources)-1:])
|
|
|
034e53 |
+ z, err := loadLocation("America/Los_Angeles", zoneSources)
|
|
|
034e53 |
if err != nil {
|
|
|
034e53 |
panic("cannot load America/Los_Angeles for testing: " + err.Error())
|
|
|
034e53 |
}
|
|
|
034e53 |
@@ -21,8 +23,9 @@ func initTestingZone() {
|
|
|
034e53 |
var OrigZoneSources = zoneSources
|
|
|
034e53 |
|
|
|
034e53 |
func forceZipFileForTesting(zipOnly bool) {
|
|
|
034e53 |
- zoneSources = make([]string, len(OrigZoneSources))
|
|
|
034e53 |
+ zoneSources = make([]string, len(OrigZoneSources)+1)
|
|
|
034e53 |
copy(zoneSources, OrigZoneSources)
|
|
|
034e53 |
+ zoneSources = append(zoneSources, runtime.GOROOT()+"/lib/time/zoneinfo.zip")
|
|
|
034e53 |
if zipOnly {
|
|
|
034e53 |
zoneSources = zoneSources[len(zoneSources)-1:]
|
|
|
034e53 |
}
|
|
|
034e53 |
diff -up go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_test.go.time go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_test.go
|
|
|
034e53 |
--- go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_test.go.time 2017-12-05 01:10:10.000000000 +0100
|
|
|
034e53 |
+++ go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_test.go 2017-12-05 14:58:09.823109248 +0100
|
|
|
034e53 |
@@ -8,6 +8,7 @@ import (
|
|
|
034e53 |
"fmt"
|
|
|
034e53 |
"os"
|
|
|
034e53 |
"reflect"
|
|
|
034e53 |
+ "runtime"
|
|
|
034e53 |
"testing"
|
|
|
034e53 |
"time"
|
|
|
034e53 |
)
|
|
|
034e53 |
@@ -128,7 +129,7 @@ func TestLoadLocationFromTZData(t *testi
|
|
|
034e53 |
t.Fatal(err)
|
|
|
034e53 |
}
|
|
|
034e53 |
|
|
|
034e53 |
- tzinfo, err := time.LoadTzinfo(locationName, time.OrigZoneSources[len(time.OrigZoneSources)-1])
|
|
|
034e53 |
+ tzinfo, err := time.LoadTzinfo(locationName, runtime.GOROOT()+"/lib/time/zoneinfo.zip")
|
|
|
034e53 |
if err != nil {
|
|
|
034e53 |
t.Fatal(err)
|
|
|
034e53 |
}
|
|
|
034e53 |
diff -up go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_unix.go.time go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_unix.go
|
|
|
034e53 |
--- go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_unix.go.time 2017-12-05 01:10:10.000000000 +0100
|
|
|
034e53 |
+++ go-dd7cbf3a846c2cb125ac65173abaf6a8b9f903ff/src/time/zoneinfo_unix.go 2017-12-05 14:55:10.574637475 +0100
|
|
|
034e53 |
@@ -12,7 +12,6 @@
|
|
|
034e53 |
package time
|
|
|
034e53 |
|
|
|
034e53 |
import (
|
|
|
034e53 |
- "runtime"
|
|
|
034e53 |
"syscall"
|
|
|
034e53 |
)
|
|
|
034e53 |
|
|
|
034e53 |
@@ -22,7 +21,6 @@ var zoneSources = []string{
|
|
|
034e53 |
"/usr/share/zoneinfo/",
|
|
|
034e53 |
"/usr/share/lib/zoneinfo/",
|
|
|
034e53 |
"/usr/lib/locale/TZ/",
|
|
|
034e53 |
- runtime.GOROOT() + "/lib/time/zoneinfo.zip",
|
|
|
034e53 |
}
|
|
|
034e53 |
|
|
|
034e53 |
func initLocal() {
|