Skip to content

Commit

Permalink
util: Don't assume Go is installed on Windows.
Browse files Browse the repository at this point in the history
This is a workaround for golang/go#21881.
  • Loading branch information
gotasty committed May 15, 2018
1 parent 9e3a080 commit 3edc0af
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions util/date_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@

package util

import "time"
import (
"time"

"4d63.com/tz"
)

// Eastern returns the eastern timezone.
func (d date) Eastern() *time.Location {
if _eastern == nil {
_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
Expand Down

0 comments on commit 3edc0af

Please sign in to comment.