-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Parser object with custom registry
Add the Parser struct, which just stores a reference to a function registry. Give it `Parse` and `MustParse` methods, which parse paths with the supplied registry. This allows the use of a registry with custom extensions. Update the `Parse` function to delegate to a parser and add a `MustParse` function to do the same but panic instead of returning an error. Change `parse.Parse` to take a registry as an argument, and teach the Parser to pass one. Add example tests demonstrating these use cases. Update the golangci-lint config to allow functions that return interfaces defined by the spec package and to ignore the double `R.` in the `J. R. R. Tolkien" examples.
- Loading branch information
Showing
6 changed files
with
346 additions
and
35 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
Oops, something went wrong.