From 3edc0afa890b4fbdeaf1807bcf6143a88d445199 Mon Sep 17 00:00:00 2001 From: Go Tasty Date: Mon, 14 May 2018 23:40:36 -0700 Subject: [PATCH] util: Don't assume Go is installed on Windows. This is a workaround for golang/go#21881. --- util/date_windows.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/util/date_windows.go b/util/date_windows.go index c42a367..6413718 100644 --- a/util/date_windows.go +++ b/util/date_windows.go @@ -2,7 +2,11 @@ package util -import "time" +import ( + "time" + + "4d63.com/tz" +) // Eastern returns the eastern timezone. func (d date) Eastern() *time.Location { @@ -10,7 +14,11 @@ func (d date) Eastern() *time.Location { _easternLock.Lock() defer _easternLock.Unlock() if _eastern == nil { - _eastern, _ = time.LoadLocation("EST") + var err error + _eastern, err = tz.LoadLocation("EST") + if err != nil { + panic(err) + } } } return _eastern