-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
Milestone
Description
When you try to execute time.LoadLocation() on Windows program panic unless it finds zoneinfo.zip file in $GOROOT/lib/time/zoneinfo.zip. Even with ZONEINFO environment variable set you get the same panic.
Test program can be found here: http://play.golang.org/p/UgiIKSEiIP
Using golang 1.5.3 on Windows x86_64
Repro:
- Take program from playground, and compile locally on windows. (Cross compiling will result in $GOROOT pointing to $GOROOT of the original Mac OS X machine)
- Compile with go build and execute. Output should be something like this:
Found zoneinfo env: false, location: '' .
2009-11-11T07:00:00.0000+08:00
- Copy zoneinfo.zip from $GOROOT\lib\time\ to another location. E.g. C:\zoneinfo.zip
- Set ZONEINFO environment variable to point to previously copied zoneinfo E.g.
set ZONEINFO=C:\zoneinfo.zip - Move or delete your $GOROOT directory, so that it cannot be found anymore.
- Execute again
Expected output
Similar to output in step 2
Observed behavior
Program panics.
Found zoneinfo env: true, location: 'E:\zoneinfo.zip' .
open C:\Go\lib\time\zoneinfo.zip: The system cannot find the path specified.
panic: time: missing Location in call to Date