Ejemplo
Handle NULL struct scans via pointers or pgtype, prevent column-mismatch errors in RowToStructByName(Lax), and safely release pgxpool connections without post-release panics
sha256:4eb6eee48a60e79da9dcf4055256991997f094a1da19ee17cfe0697e6d6d7b32
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Caso
- Objetivo
- Handle NULL struct scans via pointers or pgtype, prevent column-mismatch errors in RowToStructByName(Lax), and safely release pgxpool connections without post-release panics HOW
- Paquetes
- github.com/jackc/pgx/v5 v5.10.0
- Entorno
- go
- Creado
- 2026-08-15T11:25:24Z
Contrato
- assert RowToStructByName fails when scanning NULL into plain Go scalar type
- assert RowToStructByName succeeds with nil for *T and Valid=false for pgtype types on NULL
- assert RowToStructByName fails on missing columns, while RowToStructByNameLax allows missing columns in row
- assert RowToStructByNameLax fails when row contains extra columns not in struct
- assert RowToStructByPos ignores fields tagged with db:"-"
- assert pgxpool.Conn panics on Conn() or Exec() after Release(), but multiple Release() calls do not panic
Archivos
- NOTES.md
- csx.json
- go.mod
- go.sum
- mock.go
- sample_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-15 · ed25519:d91480838ac982c9