Skip scalars when decoding onto unsupported types.
R=
CC=
https://codereview.appspot.com/5505058
diff --git a/decode.go b/decode.go
index 9474fd5..5640e20 100644
--- a/decode.go
+++ b/decode.go
@@ -360,8 +360,6 @@
out.Set(reflect.Zero(out.Type()))
good = true
}
- default:
- panic("Can't handle type yet: " + out.Type().String())
}
return good
}
diff --git a/decode_test.go b/decode_test.go
index 7be94cb..ad3b898 100644
--- a/decode_test.go
+++ b/decode_test.go
@@ -85,6 +85,7 @@
{"a: {b: c}", &struct{ A *struct{ B string } }{&struct{ B string }{"c"}}},
{"a: {b: c}", &struct{ A map[string]string }{map[string]string{"b": "c"}}},
{"a: {b: c}", &struct{ A *map[string]string }{&map[string]string{"b": "c"}}},
+ {"a:", &struct{ A map[string]string }{}},
{"a: 1", &struct{ A int }{1}},
{"a: [1, 2]", &struct{ A []int }{[]int{1, 2}}},
{"a: 1", &struct{ B int }{0}},