-
Notifications
You must be signed in to change notification settings - Fork 14
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
7 invalid inject #52
7 invalid inject #52
Conversation
Hi @tristanessquare, thank you for looking into this issue! Currently, the logic checks for a Lines 698 to 708 in 72b6052
After dereferencing, it goes through all fields if it's a struct type. Something along the lines of if ctype.Kind() != reflect.Ptr && current.MethodByName("Inject").IsValid() {
return errInvalidInject
} prior to the switch Line 696 in 72b6052
What do you think? |
58efddd
to
52911a7
Compare
Hi @bastianccm , thank you for the great idea. This seems to solve the problem. Now my new test and the existing ones are green. |
Hi @tristanessquare, thank you for fixing it! Just mark this ready when you are, and I'm happy to merge it! |
52911a7
to
ba221a5
Compare
ba221a5
to
427e8d6
Compare
Added a test case for the issue and started with first approach to detect struct receivers by comparing the instance with an empty instance. It seems not to be possible to find out struct receivers using reflection.
Current solution is not working for cases with struts that have no fields. See failing test cases...