-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass appropriate empty Value to hooks #45
Conversation
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
@@ -3248,6 +3251,67 @@ func TestDecoder_CanPerformDecodingForNilInputs(t *testing.T) { | |||
} | |||
} | |||
|
|||
func TestDecoder_ExpandNilStructPointersHookFunc(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.
This test would panic on main, or if the error formatting is fixed it would return 'boolean' expected type 'bool', got unconvertible type 'map[string]interface {}', value: 'map[]'
@sagikazarmark one more fix for |
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.
Thanks @yurishkuro !
I'm going to release this as 2.2.1 since it's really a bugfix for that previous PR. Good catch by the way!
Thanks! 🎉 |
This is a follow-up to PR #42 that was trying to fix issue #37. The fix included a change to set the input to an empty map
However, it was breaking some of the tests in OTEL PR because the map was not expected for non-map target types:
Changes:
.Type()
on zero value. The same issue likely exists in all other error formatting functions, but I didn't want to bundle too many fixes into this PR.Tests:
Lints:
(no script in the repo, I used a linter from Jaeger, which uses v1.61.0)