Is your feature request related to a problem? Please describe.
I have multiple named providers of the same type, and I'd like to decorate one of them
c.Provide(NewReadOnlyConnection, dig.Name("ro"))
c.Provide(NewReadWriteConnection, dig.Name("rw"))
However the decorate function doesn't have an option to target these
|
// DecorateOption modifies the default behavior of Decorate. |
|
type DecorateOption interface { |
|
apply(*decorateOptions) |
|
} |
I use this mainly for tests- replacing certain dependencies with test versions.
Is there a non-obvious way to do this? I couldn't find an example in the unit tests.
Is this a breaking change?
No, we could create a new DecorateOption
Ran into this when looking into #230
Is your feature request related to a problem? Please describe.
I have multiple named providers of the same type, and I'd like to decorate one of them
However the decorate function doesn't have an option to target these
dig/decorate.go
Lines 159 to 162 in c8eb7b9
I use this mainly for tests- replacing certain dependencies with test versions.
Is there a non-obvious way to do this? I couldn't find an example in the unit tests.
Is this a breaking change?
No, we could create a new
DecorateOptionRan into this when looking into #230