-
Notifications
You must be signed in to change notification settings - Fork 2
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
[feat] add Unused #103
base: main
Are you sure you want to change the base?
[feat] add Unused #103
Conversation
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.
IMHO it would be even better if the function returned a type Unused
. That is, explicitly in the function signature it will never be part of the chain.
I think returning Provider
invites someone to write a function that conditionally returns Unused
in some case, and some other provider in others. Which I expect would become hard logic to follow.
Take or leave that suggestion, I'm approving as is.
Hmm. Both are useful. Making a type I guess the most robust answer is that |
An error? I think better to fail than silently do something unexpected. Users will assume rather than understand (I say this as a user). |
funcs = append(funcs, nil) | ||
for i := len(funcs) - 1; i > 0; i-- { | ||
funcs[i] = funcs[i-1] | ||
} |
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.
as discussed, helper to "append to front" and "append near end"
Add
Unused
, a provider that will never be included in an injection chain.