2
0

Add scan to uint16

refs #138
This commit is contained in:
Jack Christensen
2016-04-27 08:26:59 -05:00
parent d62da82ab1
commit 623ba1eeb1
2 changed files with 53 additions and 0 deletions
+12
View File
@@ -693,6 +693,18 @@ func Decode(vr *ValueReader, d interface{}) error {
*v = decodeInt2(vr)
case *int32:
*v = decodeInt4(vr)
case *uint16:
var valInt int16
switch vr.Type().DataType {
case Int2Oid:
valInt = int16(decodeInt2(vr))
default:
return fmt.Errorf("Can't convert OID %v to uint16", vr.Type().DataType)
}
if valInt < 0 {
return fmt.Errorf("%d is less than zero for uint16", valInt)
}
*v = uint16(valInt)
case *uint32:
var valInt int32
switch vr.Type().DataType {