| 1 |
package main |
| 2 |
|
| 3 |
import ( |
| 4 |
"testing" |
| 5 |
|
| 6 |
"github.com/segmentio/encoding/json" |
| 7 |
) |
| 8 |
|
| 9 |
type Foo struct { |
| 10 |
Source struct { |
| 11 |
Table string |
| 12 |
} |
| 13 |
} |
| 14 |
|
| 15 |
func TestUnmarshal(t *testing.T) { |
| 16 |
input := []byte(`{"source": {"table": "1234567"}}`) |
| 17 |
r := &Foo{} |
| 18 |
json.Unmarshal(input, r) |
| 19 |
} |