2
0

Simplify []byte scanning

This commit is contained in:
Jack Christensen
2017-03-18 14:42:36 -05:00
parent 015108be9a
commit 92cff1d961
7 changed files with 39 additions and 39 deletions
-18
View File
@@ -217,21 +217,3 @@ func stripNamedType(val *reflect.Value) (interface{}, bool) {
return nil, false
}
func decodeBytea(vr *ValueReader) []byte {
if vr.Len() == -1 {
return nil
}
if vr.Type().DataType != ByteaOid {
vr.Fatal(ProtocolError(fmt.Sprintf("Cannot decode oid %v into []byte", vr.Type().DataType)))
return nil
}
if vr.Type().FormatCode != BinaryFormatCode {
vr.Fatal(ProtocolError(fmt.Sprintf("Unknown field description format code: %v", vr.Type().FormatCode)))
return nil
}
return vr.ReadBytes(vr.Len())
}