This repository has been archived by the owner on Oct 17, 2024. It is now read-only.
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.
Add Gt operator #103
Add Gt operator #103
Changes from 1 commit
a185af4
35f7361
8017a0d
cbaafb7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Why ignoring the error when you can return it?
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.
Because the function won't fail, I am sure that I will parse the correct type.
It's impossible to have a value in
v.Data
that mismatches the type inv.Type
.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 if I create it by hand in the seeds scripts for example?
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.
The only way to create
Value
s is to use therule.TValue
functions (whereT
is a type) and those are strongly typed thus I don't see how we can have a value that differs from the type?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.
I'm just being picky here, but Regula is a lib and you don't know how people might want to use it:
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.
From that perspective, you are right. But for this "intermediate" version I think that we can ship it like that and be more carefully in the next one.
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.
I don't think intermediate versions allow us to be less careful about what we are producing. I agree that we should not make too much effort for nothing, but here we are talking about adding an
if err != nil
that doesn't cost much.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.
This argument is enough to add the check. From time to time I forgot that the users can do whatever they want with the exported type and my opinion is based on what they are doing and how they are using it at the moment.
Will add the check in #107.