diff --git a/illegal/field_test.go b/illegal/field_test.go index b1ddcf4..ed978fe 100644 --- a/illegal/field_test.go +++ b/illegal/field_test.go @@ -17,3 +17,11 @@ func TestIllegalField(t *testing.T) { assert.Equal(t, "10 foo", s.String()) } + +func TestIllegalWrongFieldType(t *testing.T) { + var s internal.Struct + + assert.Panics(t, func() { + illegal.SetPrivateField(&s, "a", "1234") + }) +}