Moves sql outside of struct

pull/210/head
Manni Wood 2016-11-12 12:01:03 -05:00
parent 36bdbd7cb1
commit 7d7bc87396
2 changed files with 3 additions and 4 deletions

View File

@ -3018,7 +3018,6 @@ func decodeAclItemArray(vr *ValueReader) []AclItem {
// remove the '{' at the front and the '}' at the end
str = str[1 : len(str)-1]
return []AclItem{AclItem(str)}
// return []AclItem{"=r/postgres"}
}
func encodeStringSlice(w *WriteBuf, oid Oid, slice []string) error {

View File

@ -649,14 +649,14 @@ func TestAclArrayDecoding(t *testing.T) {
conn := mustConnect(t, *defaultConnConfig)
defer closeConn(t, conn)
sql := "select $1::aclitem[]"
tests := []struct {
sql string
query interface{}
scan interface{}
assert func(*testing.T, interface{}, interface{})
}{
{
"select $1::aclitem[]",
[]pgx.AclItem{"=r/postgres"},
&[]pgx.AclItem{},
func(t *testing.T, query, scan interface{}) {
@ -667,7 +667,7 @@ func TestAclArrayDecoding(t *testing.T) {
},
}
for i, tt := range tests {
err := conn.QueryRow(tt.sql, tt.query).Scan(tt.scan)
err := conn.QueryRow(sql, tt.query).Scan(tt.scan)
if err != nil {
t.Errorf(`%d. error reading array: %v`, i, err)
if pgerr, ok := err.(pgx.PgError); ok {