fix: format error should not trigger circuit breaker in sqlx (#3437)

This commit is contained in:
Kevin Wan
2023-07-23 20:40:03 +08:00
committed by GitHub
parent 05db706c62
commit ff04356704
6 changed files with 77 additions and 12 deletions

View File

@@ -5081,6 +5081,17 @@ func TestGetValueWithChainedKeys(t *testing.T) {
})
}
func TestUnmarshalFromStringSliceForTypeMismatch(t *testing.T) {
var v struct {
Values map[string][]string `key:"values"`
}
assert.Error(t, UnmarshalKey(map[string]any{
"values": map[string]any{
"foo": "bar",
},
}, &v))
}
func BenchmarkDefaultValue(b *testing.B) {
for i := 0; i < b.N; i++ {
var a struct {