Blame SOURCES/go1.5-zoneinfo_testing_only.patch

95ac52
diff --git a/src/time/internal_test.go b/src/time/internal_test.go
148502
index f0dddb7..415949a 100644
95ac52
--- a/src/time/internal_test.go
95ac52
+++ b/src/time/internal_test.go
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 {
148502
 		panic("cannot load America/Los_Angeles for testing: " + err.Error() + "; you may want to use -tags=timetzdata")
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
 	}
95ac52
diff --git a/src/time/zoneinfo_test.go b/src/time/zoneinfo_test.go
95ac52
index f032aa7..e3e5547 100644
95ac52
--- a/src/time/zoneinfo_test.go
95ac52
+++ b/src/time/zoneinfo_test.go
95ac52
@@ -9,6 +9,7 @@ import (
fc0505
 	"fmt"
fc0505
 	"os"
fc0505
 	"reflect"
fc0505
+	"runtime"
fc0505
 	"testing"
fc0505
 	"time"
fc0505
 )
95ac52
@@ -137,7 +138,7 @@ func TestLoadLocationFromTZData(t *testing.T) {
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
 	}
95ac52
diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go
148502
index 23f8b3c..228db1b 100644
95ac52
--- a/src/time/zoneinfo_unix.go
95ac52
+++ b/src/time/zoneinfo_unix.go
148502
@@ -12,7 +12,6 @@
fc0505
 package time
fc0505
 
fc0505
 import (
fc0505
-	"runtime"
fc0505
 	"syscall"
fc0505
 )
fc0505
 
148502
@@ -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() {