Ejemplo
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
Caso
- Objetivo
- Format pgtype.Timestamp to ISO 8601 JSON without timezone offset matching PostgreSQL to_json, and parse JSON timestamps into pgtype.Timestamp HOW
- Paquetes
- github.com/jackc/pgx/v5 v5.7.3
- Entorno
- go
- Creado
- 2026-08-16T06:21:36Z
Contrato
- 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
Archivos
- NOTES.md
- csx.json
- go.mod
- go.sum
- timestamp_test.go
Descargar el artefacto verificado (tar.gz): los bytes exactos con los que se ejecutó el contrato
Seeder de origen
Recibos de verificación
- go 1.26 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-16 · ed25519:d91480838ac982c9