-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: return multiple errors on validation call.
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
- Loading branch information
Showing
11 changed files
with
196 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.