Skip to content

Accept small integer types as Unix timestamps - #381

Open
draarivpatel-ui wants to merge 1 commit into
spf13:masterfrom
draarivpatel-ui:fix-time-small-integer-types
Open

draarivpatel-ui wants to merge 1 commit into
spf13:masterfrom
draarivpatel-ui:fix-time-small-integer-types

Conversation

@draarivpatel-ui

@draarivpatel-ui draarivpatel-ui commented Nov 26, 2026 •

Copy link
Copy Markdown

Summary

ToTimeE now accepts int8, int16, uint8, and uint16 values as Unix timestamps, matching the other signed and unsigned integer types it already accepts.

Root cause

The numeric type switch in ToTimeInDefaultLocationE handled the wider integer types but omitted the small ones, so these values returned a cast error even though they cannot overflow the conversion to int64.

Regression tests

Added timestamp cases for all four omitted types.

Verification

taskpolicy -b nice -n 19 env GOMAXPROCS=2 go test -run '^TestTime$' -count=1 . passes.

A full go test ./... run reaches unrelated pre-existing TestTimeWithTimezones failures in this local timezone environment; the changed conversion path is covered by the focused test above.

Copilot AI balanced review requested due to automatic review settings November 26, 2026 00:09
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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.

3 participants