-
Notifications
You must be signed in to change notification settings - Fork 696
Will not panic on interface type in struct. #62
Conversation
Thanks @davrux for the fix. Can you please add a test case? Currently all our test passed, but seems like there is no case for this. Having it would guarantee stability in the future. |
Hi, will add a test when i am back at home. I add it to the same branch.
|
@@ -1362,3 +1362,18 @@ func TestNonStringerTagWithStringOption(t *testing.T) { | |||
t.Errorf("Value for field Animal should not exist") | |||
} | |||
} | |||
|
|||
func TestInterfaceInStruct(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rename this to TestMap_IntervaceValue
@@ -1362,3 +1362,18 @@ func TestNonStringerTagWithStringOption(t *testing.T) { | |||
t.Errorf("Value for field Animal should not exist") | |||
} | |||
} | |||
|
|||
func TestInterfaceInStruct(t *testing.T) { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this newline
Thanks @davrux 👍 |
* 'master' of github.com:fatih/structs: (25 commits) struct: add comment about the if clause nest into struct for slice of pointer of struct fix: panic when passing pointer to pointer as param field: test CanSet failure fixed flatten documentation Will not panic on interface type in struct. (fatih#62) structs: add support for map and slice type Fix set value on nested field Fix some methods' descriptions to match code Fix print verb in a test created flatnested tag to convert the anonymous field in a flat map (fatih#46) [Typo] Fixes a typo in field.go Update .travis.yml structs: add tests for FillMap Add FillMap(s interface{}, out map[string]interface{}) README.md: make example better Update field.go use stringer if string tag option is used fix typos updated the fix to avoid performance impact (PR fatih#40) ...
Fixes Latest version panics on interface{} #61