mirror of https://github.com/jackc/pgx.git
Merge branch 'patch-1' of https://github.com/eruca/pgx into eruca-patch-1
commit
6ca9b1279e
|
@ -184,3 +184,15 @@ func (src *Int8) MarshalJSON() ([]byte, error) {
|
|||
|
||||
return nil, errBadStatus
|
||||
}
|
||||
|
||||
func (dst *Int8) UnmarshalJSON(b []byte) error {
|
||||
var n int64
|
||||
err := json.Unmarshal(b, &n)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*dst = Int8{Int: n, Status: Present}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue