-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add optional.ExtractValue() to be able to handle Option type within interface{} value #29794
Conversation
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.
What's the usecase of this?
usecase would be to make gitea/routers/web/user/home.go Line 335 in 487ac9b
optional.Option aware etc... |
should I add this usecase in here too? |
How/Where gets the |
if we start to adopt and use optionals more widly instead of type refs ... |
Actually IMO the design of If the For example, when I read the code: |
-> Refactor AddParam to AddParamIfExist #29834 |
In this regards it looks like it is not jet needed, so I'll close this pull and everybody is free to pick that patch if needed in the future |
as title ... add an helper func for optional.Option type(s)
because simple type cast wont work if you not know the exact T type too ... (or want your func handle all Option Types ...)