Merge branch 'eruca-patch-1'
This commit is contained in:
@@ -3,6 +3,7 @@ package pgtype
|
|||||||
import (
|
import (
|
||||||
"database/sql/driver"
|
"database/sql/driver"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
|
"encoding/json"
|
||||||
"math"
|
"math"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
@@ -184,3 +185,15 @@ func (src *Int8) MarshalJSON() ([]byte, error) {
|
|||||||
|
|
||||||
return nil, errBadStatus
|
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
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user