Skip to content
This repository has been archived by the owner on Oct 11, 2018. It is now read-only.

Will not panic on interface type in struct. #62

Merged
merged 3 commits into from
Jun 15, 2016
Merged

Will not panic on interface type in struct. #62

merged 3 commits into from
Jun 15, 2016

Conversation

davrux
Copy link
Contributor

@davrux davrux commented Jun 15, 2016

Fixes Latest version panics on interface{} #61

@coveralls
Copy link

coveralls commented Jun 15, 2016

Coverage Status

Coverage decreased (-0.5%) to 98.966% when pulling cd81a3f on davrux:interfacefix into f23af60 on fatih:master.

@fatih
Copy link
Owner

fatih commented Jun 15, 2016

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.

@davrux
Copy link
Contributor Author

davrux commented Jun 15, 2016

Hi,

will add a test when i am back at home. I add it to the same branch.
On Jun 15, 2016 16:30, "Fatih Arslan" notifications@github.com wrote:

Thanks @davrux https://github.com/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.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#62 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AHneWCGhwMW0jdb_zopVb4MikuElwIscks5qMAxngaJpZM4I2Z8W
.

@@ -1362,3 +1362,18 @@ func TestNonStringerTagWithStringOption(t *testing.T) {
t.Errorf("Value for field Animal should not exist")
}
}

func TestInterfaceInStruct(t *testing.T) {
Copy link
Owner

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

@coveralls
Copy link

coveralls commented Jun 15, 2016

Coverage Status

Coverage remained the same at 99.483% when pulling 3296949 on davrux:interfacefix into f23af60 on fatih:master.

@@ -1362,3 +1362,18 @@ func TestNonStringerTagWithStringOption(t *testing.T) {
t.Errorf("Value for field Animal should not exist")
}
}

func TestInterfaceInStruct(t *testing.T) {

Copy link
Owner

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

@coveralls
Copy link

coveralls commented Jun 15, 2016

Coverage Status

Coverage remained the same at 99.483% when pulling 396129a on davrux:interfacefix into f23af60 on fatih:master.

@fatih fatih merged commit c7685df into fatih:master Jun 15, 2016
@fatih
Copy link
Owner

fatih commented Jun 15, 2016

Thanks @davrux 👍

mertenvg pushed a commit to whitecypher/structs that referenced this pull request Aug 29, 2016
* '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)
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants