Skip to content

fix: embed IANA timezone database for Windows support#388

Merged
steipete merged 1 commit intoopenclaw:mainfrom
visionik:fix/tz-on-windows
Mar 7, 2026
Merged

fix: embed IANA timezone database for Windows support#388
steipete merged 1 commit intoopenclaw:mainfrom
visionik:fix/tz-on-windows

Conversation

@visionik
Copy link
Copy Markdown
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
@steipete steipete merged commit 4b1d1d4 into openclaw:main Mar 7, 2026
2 of 6 checks passed
@steipete
Copy link
Copy Markdown
Collaborator

steipete commented Mar 7, 2026

Landed via temp rebase onto main.

  • Gate: make ci
  • Land commit: a4428d3a9491a7c5a98617f39b5f8e6185e640e9
  • Merge commit: 4b1d1d4

Thanks @visionik!

klodr pushed a commit to klodr/gogcli that referenced this pull request Apr 22, 2026
- 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)
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.

2 participants