dig icon indicating copy to clipboard operation
dig copied to clipboard

Support parameter embedding in dig.In/dig.Out

Open ursatong opened this issue 10 months ago • 0 comments

Is your feature request related to a problem? Please describe. Share common fields of Parameter Objects

type SorterParams struct {
	ASorter *ASorter
	BSorter *BSorter
}

type AParams struct {
	dig.In

	SorterParams
	AFilter *AFilter
	BFilter *BFilter
}

type BParams struct {
	dig.In

	SorterParams
	AFilter *CFilter
	BFilter *DFilter
}

Want to share the common Sorters between Parameter Objects AParams and BParams, but this doesn't work.

Describe the solution you'd like It should work as if I copied the fields manually

Describe alternatives you've considered Passing SorterParams also as a parameter objects. but this again makes it less readable.

Is this a breaking change? no

ursatong avatar Feb 24 '25 22:02 ursatong