(t *testing.T)
| 156 | } |
| 157 | |
| 158 | func TestAnonymousStructField(t *testing.T) { |
| 159 | type MyInt struct{ int } |
| 160 | |
| 161 | type MyStruct struct { |
| 162 | Ints []MyInt `pg:",array"` |
| 163 | } |
| 164 | |
| 165 | db := testDB() |
| 166 | |
| 167 | var st MyStruct |
| 168 | _, err := db.Query(&st, "SELECT ARRAY[1,2,3,4] AS ints") |
| 169 | Expect(err).ToNot(BeNil()) |
| 170 | if !strings.Contains(err.Error(), "json: cannot unmarshal") { |
| 171 | t.Fatal(err) |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | func TestContextCanceled(t *testing.T) { |
| 176 | db := testDB() |