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