feat: new method for fetching ignoring error #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This may sound crazy, but I am working on a codebase where we use OpenAPI schema to describe a (YAML) document. All fields (except document name) are optional so I have to work with many optional fiels. While I want to explore the new feature
omitzero
, I am evaluatingnullable
to do the heavylifting and I am not even sure if this is gonna work yet.But I would love to have a method - workting title -
Dig
that does exactly whatGet
does but ignores the error and returns an empty value. Assuming that all fields within structs are also treated withnullable
my theory is this can simulate behavior ofomitzero
.Am I crazy? I think I am. Well, let’s hear from others. I am unsure about the name for such method, but I want something that is short so I came up with
Dig
which is probably too wild. ButGetWithoutError
would not work that is way too long. Also this does not have tests yet because I am unsure if you like this or if there are not flaws in my idea.