-
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 ReplaceNamed(), InsertBeforeNamed(), and InsertAfterNamed() #63
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #63 +/- ##
==========================================
+ Coverage 83.89% 84.40% +0.50%
==========================================
Files 21 22 +1
Lines 3024 3186 +162
==========================================
+ Hits 2537 2689 +152
- Misses 317 323 +6
- Partials 170 174 +4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
|
||
// This demonstrates how it to have a default that gets overridden by | ||
// by later inputs using Reorder | ||
func ExampleReorder() { |
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.
Moved as-is
replace.go
Outdated
// be tagging a colleciton, not an individual. | ||
func (c *Collection) handleReplaceByName() (err error) { | ||
defer func() { | ||
// if err != nil { |
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.
is this meant to be commented out?
replace.go
Outdated
if err != nil { | ||
return err | ||
} | ||
firstMove, lastMove := snip(n, func(n *node) bool { return n.fm.insertBeforeName == name }) |
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.
firstMove, lastMove := snip(n, func(n *node) bool { return n.fm.insertBeforeName == name }) | |
firstMove, lastMove := snip(n, func(n *node) bool { return n.fm.insertAfterName == name }) |
replace.go
Outdated
// step 4, convert back to list | ||
contents := make([]*provider, 0, len(c.contents)) | ||
for n := head.next; n != tail; n = n.next { | ||
if n.fm != nil && n.fm.fn != nil { |
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.
can this condition be false?
New functions that allow manipulating the injection chain using the names assigned with
Provide()