-
-
Notifications
You must be signed in to change notification settings - Fork 559
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
Add nil check for user type in gen_app #1073
Conversation
Would you try this to your project? @luna-duclos |
Just tested this, code looks good, and code works! 👍 |
Thank you for the great PR with additional tests! I am wondering though if it wouldn't be better to put the test in the caller (https://github.com/goadesign/goa/blob/master/goagen/codegen/publicizer.go#L130) rather than in the |
I think a function not blowing up on nil is generally good behaviour. I can see your point about masking other bugs however, but considering these bugs would usually be the same nil check .. I don't see the harm |
For example you may end up with code that is generated fine but does not compile because the |
301bd83
to
370d21d
Compare
I reverted the commit and moved nil check to publicizer for hash. Is it correct? |
Yes perfect, thank you for making the change! |
* Add tests for UserTypeWriter in gen_app * Add nil check for user type in gen_app * Revert "Add nil check for user type in gen_app" This reverts commit ecf0f68. * Add nil check in publicizer for hash
Fix #1060.