You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the slice of string should be the result of appending err.Error() to the result anytime err != nil in the validation stack. the function should only return error != nil if the data won't parse.
The text was updated successfully, but these errors were encountered:
This commit introduces a new type: ValError and adjusts the
signature of Validator.Validate to return a slice of ValError
instead of a single error. This change comes with the expectation
that all validators should return the full list of errors that
a given validator detects. Error-free passes can return either
nil or an empty []ValError slice.
This adjustment starts with a basic "just supply the message",
but ValError comes with extra fields that we can iterate upon
to populate in the future.
Having the full list of errors for a given instance makes this
package far more useful, at the expense of forcing implementers
to understand a few extra things. Meh. Worth it.
closes#15
currently we only have one usable Method for Validation:
That bails on the first error it sees.
We need a method that collects all known errors in a slice of bytes. I'm thinking it's signature should look like this:
the slice of string should be the result of appending
err.Error()
to the result anytimeerr != nil
in the validation stack. the function should only returnerror != nil
if the data won't parse.The text was updated successfully, but these errors were encountered: