Skip to content

Support parameter embedding in dig.In/dig.Out #427

@ursatong

Description

@ursatong

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions