File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -579,3 +579,11 @@ func (c *Collection) MustSetCallback(binderFunction interface{}) {
579579 panic (DetailedError (err ))
580580 }
581581}
582+
583+ type unused struct {}
584+
585+ // Unused is value that a function that returns injectors can return that will never be
586+ // included in an injection chain. Unused can be used in situations where you want to
587+ // call a function as part of generating a list of injectors and functions in such a list
588+ // must have a return value.
589+ var Unused = Provide ("unused" , unused {})
Original file line number Diff line number Diff line change @@ -305,6 +305,9 @@ func TestLiteral(t *testing.T) {
305305 counts := make (map [string ]int )
306306 c := Sequence ("TBF" ,
307307 s1 ("s1 value" ),
308+ func () Provider {
309+ return Unused
310+ }(),
308311 Cacheable (func (s s1 ) s2 {
309312 counts ["s2" ]++
310313 assert .Equal (t , s1 ("s1 value" ), s )
You can’t perform that action at this time.
0 commit comments