Skip to content

refactor: replace 4d63.com/tz with time/tzdata#8408

Merged
aaron-prindle merged 1 commit intoGoogleContainerTools:mainfrom
pmalek:replace-4d63.com/tz-with-time/tzdata
Feb 6, 2023
Merged

refactor: replace 4d63.com/tz with time/tzdata#8408
aaron-prindle merged 1 commit intoGoogleContainerTools:mainfrom
pmalek:replace-4d63.com/tz-with-time/tzdata

Conversation

@pmalek
Copy link
Copy Markdown
Contributor

@pmalek pmalek commented Feb 4, 2023

Description

Looking at https://github.com/leighmcculloch/go-tz ( 4d63.com/tz import path

4d63.com/tz v1.2.0
) it seems that the repo is unmaintained:

Deprecated: Use time/tzdata available in Go 1.15. time/tzdata does not work exactly the same as it defaults to local tzdata when available where as this package always uses embedded data. This package will be maintained until Go 1.16 is released.

This PR replaces usage of that package with time/tzdata by include a build tag timetzdata as suggested at https://pkg.go.dev/time/tzdata. An alternative is to import time/tzdata as suggested:

This package should normally be imported by a program's main package, not by a library. Libraries normally shouldn't decide whether to include the timezone database in a program.

Open questions

Tests at https://github.com/GoogleContainerTools/skaffold/blob/main/pkg/skaffold/tag/date_time_test.go seem to pass (at least locally). Do we want to include more for this change?

@pmalek pmalek marked this pull request as ready for review February 4, 2023 17:33
@aaron-prindle aaron-prindle added the kokoro:run runs the kokoro jobs on a PR label Feb 6, 2023
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Feb 6, 2023
Copy link
Copy Markdown
Contributor

@aaron-prindle aaron-prindle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pmalek thanks for the PR here, LGTM! The tests you updated should be enough here.

@aaron-prindle aaron-prindle merged commit 7ca9a2d into GoogleContainerTools:main Feb 6, 2023
@pmalek pmalek deleted the replace-4d63.com/tz-with-time/tzdata branch February 6, 2023 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants