util: Don't assume Go is installed on Windows.
This is a workaround for golang/go#21881.
This commit is contained in:
parent
9e3a080aa3
commit
3edc0afa89
1 changed files with 10 additions and 2 deletions
|
@ -2,7 +2,11 @@
|
||||||
|
|
||||||
package util
|
package util
|
||||||
|
|
||||||
import "time"
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"4d63.com/tz"
|
||||||
|
)
|
||||||
|
|
||||||
// Eastern returns the eastern timezone.
|
// Eastern returns the eastern timezone.
|
||||||
func (d date) Eastern() *time.Location {
|
func (d date) Eastern() *time.Location {
|
||||||
|
@ -10,7 +14,11 @@ func (d date) Eastern() *time.Location {
|
||||||
_easternLock.Lock()
|
_easternLock.Lock()
|
||||||
defer _easternLock.Unlock()
|
defer _easternLock.Unlock()
|
||||||
if _eastern == nil {
|
if _eastern == nil {
|
||||||
_eastern, _ = time.LoadLocation("EST")
|
var err error
|
||||||
|
_eastern, err = tz.LoadLocation("EST")
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return _eastern
|
return _eastern
|
||||||
|
|
Loading…
Reference in a new issue