We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Thanks for providing a useful library.
Currently, I need to do the following to determine the default value
const defaultPath = "magic.dat" // somewhere in the package optPath := gonull.NewNullable("hello.dat") path := "" if optPath.Valid { path = optPath.Val } else { path = defaultPath }
Suggestion is to add a new receiver method OrElse so that this can be done in one line
OrElse
path := optPath.OrElse(defaultPath)
Signature:
func (n *Nullable[T]) OrElse(value T) T
The text was updated successfully, but these errors were encountered:
I can make the PR if you are ok. Thanks
Sorry, something went wrong.
Hey @apatniv, this is really nice feature and I would love to see it in the next release. using OrElse we can reduce the amount of if else conditions.
Feel free to rise a PR, I'll be more than happy to approve it.
Thank you for your feedback and open-source contribution.
PR #17
No branches or pull requests
Thanks for providing a useful library.
Currently, I need to do the following to determine the default value
Suggestion is to add a new receiver method
OrElse
so that this can be done in one lineSignature:
The text was updated successfully, but these errors were encountered: