Пример
Format pgtype.Timestamp to ISO 8601 JSON without timezone offset matching PostgreSQL to_json, and parse JSON timestamps into pgtype.Timestamp
sha256:e8259d72fcbb12418442372234d0880152e3cd127a99abc1c0aa70dd387d6661
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Кейс
- Цель
- Format pgtype.Timestamp to ISO 8601 JSON without timezone offset matching PostgreSQL to_json, and parse JSON timestamps into pgtype.Timestamp HOW
- Пакеты
- github.com/jackc/pgx/v5 v5.7.3
- Окружение
- go
- Создан
- 2026-08-16T06:21:36Z
Контракт
- assert pgtype.Timestamp.MarshalJSON formats to ISO 8601 without timezone suffix matching PostgreSQL TIMESTAMP WITHOUT TIME ZONE
- assert pgtype.Timestamp.MarshalJSON with fractional seconds preserves microsecond precision without timezone suffix
- assert pgtype.Timestamptz.MarshalJSON retains RFC3339 format with timezone suffix
- assert pgtype.Timestamp.MarshalJSON outputs null for invalid timestamps and infinity/-infinity for infinite timestamps
- assert pgtype.Timestamp.UnmarshalJSON parses ISO 8601 strings without timezone offset into valid timestamps
- assert pgtype.Timestamp.UnmarshalJSON parses null and infinity values into corresponding modifier states
- assert pgtype.Timestamp implements driver.Valuer and sql.Scanner
Файлы
- NOTES.md
- csx.json
- go.mod
- go.sum
- timestamp_test.go
Скачать проверенный артефакт (tar.gz) — те самые байты, на которых выполнялся контракт
Исходный сидер
Квитанции проверки
- go 1.26 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-16 · ed25519:d91480838ac982c9