Conversation
dncohen
left a comment
There was a problem hiding this comment.
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). |
bind.go
Outdated
| funcs = append(funcs, nil) | ||
| for i := len(funcs) - 1; i > 0; i-- { | ||
| funcs[i] = funcs[i-1] | ||
| } |
There was a problem hiding this comment.
as discussed, helper to "append to front" and "append near end"
Add
Unused, a provider that will never be included in an injection chain.