Skip to content

Allow name and group Result Tags #380

@jquirke

Description

@jquirke

Describe the solution you'd like

This is linked from an Fx feature request: uber-go/fx#998

Furthermore, it is a necessary stepping stone to another Fx feature request uber-go/fx#1036

The restriction on allowing name and group tags seems artificial. For example, this is not permitted:

type Result struct {
    dig.Out
    Foo1 Foo `name:"foo1" group:"foos"`
}

In order to populate by name and groups elsewhere.

Describe alternatives you've considered

An output dig struct can be written with multiple outputs, but that is rather clumsy.

type Result struct {
    dig.Out
    Foo1 Foo `name:"foo1"`
    Foos []Foo `group:"foos"`
}

Is this a breaking change?

Not likely. Since the desired behaviour is not currently permitted, it should not break any existing applications.

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