Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstracted path.Matcher to Matcher interface #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sampaioletti
Copy link

Hello,

I had a project where I was using your library, but needed different matching than path.Match (our strings have "/" in them, but are not paths).

So I pulled the match functionality out into an interface to make it easier to override. Thought I'd push it back and see if it was useful.

Thanks for the cool library.

@razorness
Copy link

Is there any reason why this is not getting merged?

@olebedev olebedev self-requested a review September 11, 2020 08:15
Copy link
Owner

@olebedev olebedev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intention looks good to me. I would prefer to keep the API non-broken. I've left a comment below, ptal

}
// optionally include a matcher to use or nil to use the default
// which implements path.Match() from the system library
func New(capacity uint, matcher Matcher) *Emitter {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about to create another function/constructor, like:

func NewWithMatcher(capacity uint, matcher Matcher) *Emitter {

or make it a variadic function, like:

func New(capacity uint, matcher ...Matcher) *Emitter {

rather than introducing a broken change?

I would prefer to don't change the existing library's API if it's not a but fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants