Reject the zero instant in Timestamp.Scan
CI / ci (push) Successful in 48s
CI / ci (pull_request) Successful in 49s
Independent review Codex gpt-6-sol high: APPROVED (0 findings)

Scan accepted "0001-01-01T00:00:00.000Z" and produced a zero Timestamp
that Value then refused to write. Reject it on read, consistent with Value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-03 08:52:14 -04:00
co-authored by Claude Opus 5.5
parent e99ddec433
commit 5de7a0df15
2 changed files with 6 additions and 1 deletions
+1
View File
@@ -72,6 +72,7 @@ func TestTimestampRejects(t *testing.T) {
for _, src := range []any{
nil, int64(0), []byte("2026-10-03T12:37:05.123Z"), "2026-10-03T12:37:05Z",
"2026-10-03T08:37:05.123-04:00", "2026-10-03T12:37:05,123Z", "garbage",
"0001-01-01T00:00:00.000Z",
} {
var ts Timestamp
if err := ts.Scan(src); err == nil {