Skip to content

Conversation

@ccremer
Copy link
Owner

@ccremer ccremer commented Aug 7, 2022

Summary

This actually conforms to the usual "must" convention.
Besides, returning nil if a key is not found only hides the root cause when troubleshooting
nil pointer panics.

Users that depend on previous behaviour (returning nil or default value) can now use new function LoadFromContextOrDefault and pass a default value that is returned in case of inexisting key.

Checklist

  • Categorize the PR by setting a good title and adding one of the labels:
    fix, enhancement, documentation, change, breaking, dependency
    as they show up in the changelog
  • Update documentation.
  • Update tests.

ccremer added 2 commits August 7, 2022 16:59
This actually conforms to the usual "must" convention.
Besides, returning nil if a key is not found only hides the root cause when troubleshooting
nil pointer panics.
@ccremer ccremer merged commit 0278dc8 into master Aug 7, 2022
@ccremer ccremer deleted the must-load-context branch August 7, 2022 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants