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