Handles parse error for aclitem[]
This commit is contained in:
@@ -3176,9 +3176,11 @@ func decodeAclItemArray(vr *ValueReader) []AclItem {
|
|||||||
|
|
||||||
// remove the '{' at the front and the '}' at the end
|
// remove the '{' at the front and the '}' at the end
|
||||||
str = str[1 : len(str)-1]
|
str = str[1 : len(str)-1]
|
||||||
strs, _ := ParseAclItemArray(str)
|
strs, err := ParseAclItemArray(str)
|
||||||
// XXX: what do I do with the error here?
|
if err != nil {
|
||||||
// XXX strs := strings.Split(str, ",")
|
vr.Fatal(ProtocolError(err.Error()))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// cast strings into AclItems before returning
|
// cast strings into AclItems before returning
|
||||||
aclitems := make([]AclItem, len(strs))
|
aclitems := make([]AclItem, len(strs))
|
||||||
|
|||||||
@@ -649,7 +649,6 @@ func assertAclItemSlicesEqual(t *testing.T, query, scan []pgx.AclItem) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX
|
|
||||||
func TestAclArrayDecoding(t *testing.T) {
|
func TestAclArrayDecoding(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user