diff --git a/structure_test.go b/structure_test.go index f3d1e51..3c822fe 100644 --- a/structure_test.go +++ b/structure_test.go @@ -779,4 +779,13 @@ func TestName(t *testing.T) { if m != "" { t.Error("Name should return empty string for unnamed struct, got: %s", n) } + + defer func() { + err := recover() + if err == nil { + t.Error("Name should panic if a non struct is passed") + } + }() + + Name([]string{}) }