Skip to content

Commit

Permalink
Modify testcase to illustrate issue #378
Browse files Browse the repository at this point in the history
  • Loading branch information
vangent committed Sep 4, 2018
1 parent 5f06140 commit ecd11e6
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,15 @@ func (m *MainService) String() string {
return fmt.Sprintf("%d %d %d", m.Foo.Cfg.V, m.Bar.Cfg.V, m.Baz.Cfg.V)
}

func newMainService(*foo.Config, *bar.Config, *baz.Config) *MainService {
func newMainService(cfg *MainConfig) *MainService {
wire.Build(
MainService{},
foo.New,
wire.Value(cfg.Foo),
bar.New,
wire.Value(cfg.Bar),
baz.New,
wire.Value(cfg.Baz),
)
return nil
}
Expand All @@ -57,6 +60,6 @@ func main() {
Bar: &bar.Config{2},
Baz: &baz.Config{3},
}
svc := newMainService(cfg.Foo, cfg.Bar, cfg.Baz)
svc := newMainService(cfg)
fmt.Println(svc.String())
}

0 comments on commit ecd11e6

Please sign in to comment.