pgtype
pgtype copied to clipboard
Decoding underlying type
I have this type
type Fecha int
It's value is stored in the database as Date.
It has the functions DecodeBinary, EncodeBinary and seems to work fine.
The problem appears when I try to do Scan on a pointer value:
type Foo struct {
Date1 Fecha // Works fine
Date2 *Fecha
}
If Date2 is NULL it works fine.
If Date2 has a value I get: can't scan into dest[1]: unable to assign to *int
¿How should I handle this?