fix: embed IANA timezone database for Windows support#388
Open
visionik wants to merge 1 commit intosteipete:mainfrom
Open
fix: embed IANA timezone database for Windows support#388visionik wants to merge 1 commit intosteipete:mainfrom
visionik wants to merge 1 commit intosteipete:mainfrom
Conversation
9355b84 to
6fe67dd
Compare
6fe67dd to
73e55cb
Compare
- 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)
73e55cb to
2f2c4aa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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), makingtime.LoadLocationwork transparently on Windows.cmd/gog/tzdata_test.go: New test verifyingLoadLocationsucceeds for 8 representative IANA zones. Guards against accidental removal of the import..github/workflows/ci.yml: Addedwindows-latestCI job running the full gate (tools, fmt-check, test, lint, build).Testing
go test ./...)golangci-lint: 0 issues)TestEmbeddedTZDatapassesHat tip to @wirihere for bringing up the issue in #118
Written by @visionik, https://deft.md, and @warpdotdev