mirror of
https://github.com/jackc/pgx.git
synced 2025-05-31 11:42:24 +00:00
UnmarshalJSON for Int8 missing
This commit is contained in:
parent
4fb47ac8c9
commit
de72a2c730
@ -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…
x
Reference in New Issue
Block a user