Skip to content

fix: embed IANA timezone database for Windows support#388

Open
visionik wants to merge 1 commit intosteipete:mainfrom
visionik:fix/tz-on-windows
Open

fix: embed IANA timezone database for Windows support#388
visionik wants to merge 1 commit intosteipete:mainfrom
visionik:fix/tz-on-windows

Conversation

@visionik
Copy link
Collaborator

@visionik visionik commented Mar 2, 2026

Summary

time.LoadLocation() fails on Windows because Go does not bundle the IANA timezone database on that platform. This affects all timezone resolution paths (user flags, env vars, config, and Google Calendar API responses).

Changes

  • cmd/gog/main.go: Import _ "time/tzdata" to embed the IANA tz database into the binary (~450KB increase), making time.LoadLocation work transparently on Windows.
  • cmd/gog/tzdata_test.go: New test verifying LoadLocation succeeds for 8 representative IANA zones. Guards against accidental removal of the import.
  • .github/workflows/ci.yml: Added windows-latest CI job running the full gate (tools, fmt-check, test, lint, build).

Testing

  • All existing tests pass locally (go test ./...)
  • Lint clean (golangci-lint: 0 issues)
  • New TestEmbeddedTZData passes
  • Windows CI job will validate the fix on the target platform

Hat tip to @wirihere for bringing up the issue in #118

Written by @visionik, https://deft.md, and @warpdotdev

- Import time/tzdata in cmd/gog/main.go to bundle the IANA tz database
  into the binary (~450KB), fixing time.LoadLocation on Windows
- Add tzdata_test.go verifying LoadLocation works for representative zones
- Add windows-latest CI job running the full gate (fmt, lint, test, build)
@visionik visionik force-pushed the fix/tz-on-windows branch from 73e55cb to 2f2c4aa Compare March 3, 2026 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant