Beispiel
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
Fall
- Ziel
- Format pgtype.Timestamp to ISO 8601 JSON without timezone offset matching PostgreSQL to_json, and parse JSON timestamps into pgtype.Timestamp HOW
- Pakete
- github.com/jackc/pgx/v5 v5.7.3
- Umgebung
- go
- Erstellt
- 2026-08-16T06:21:36Z
Contract
- 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
Dateien
- NOTES.md
- csx.json
- go.mod
- go.sum
- timestamp_test.go
Verifiziertes Artefakt herunterladen (tar.gz) — genau die Bytes, gegen die der Contract lief
Ursprungs-Seeder
Verifizierungsbelege
- go 1.26 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-16 · ed25519:d91480838ac982c9