wire: use package names to disambiguate variables (google/go-cloud#386)
This commit is contained in:
committed by
Ross Light
parent
fab79bd5bd
commit
c999a4d1b5
@@ -14,14 +14,14 @@ import (
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func newMainService(config *foo.Config, config2 *bar.Config, config3 *baz.Config) *MainService {
|
||||
func newMainService(config *foo.Config, barConfig *bar.Config, bazConfig *baz.Config) *MainService {
|
||||
service := foo.New(config)
|
||||
service2 := bar.New(config2, service)
|
||||
service3 := baz.New(config3, service2)
|
||||
barService := bar.New(barConfig, service)
|
||||
bazService := baz.New(bazConfig, barService)
|
||||
mainService := &MainService{
|
||||
Foo: service,
|
||||
Bar: service2,
|
||||
Baz: service3,
|
||||
Bar: barService,
|
||||
Baz: bazService,
|
||||
}
|
||||
return mainService
|
||||
}
|
||||
|
||||
@@ -12,9 +12,9 @@ import (
|
||||
// Injectors from wire.go:
|
||||
|
||||
func inject(context3 context2.Context, err2 struct{}) (context, error) {
|
||||
context4, err := provide(context3)
|
||||
mainContext, err := provide(context3)
|
||||
if err != nil {
|
||||
return context{}, err
|
||||
}
|
||||
return context4, nil
|
||||
return mainContext, nil
|
||||
}
|
||||
|
||||
@@ -15,11 +15,11 @@ import (
|
||||
// Injectors from foo.go:
|
||||
|
||||
func inject(context3 context2.Context, err2 struct{}) (context, error) {
|
||||
context4, err := Provide(context3)
|
||||
mainContext, err := Provide(context3)
|
||||
if err != nil {
|
||||
return context{}, err
|
||||
}
|
||||
return context4, nil
|
||||
return mainContext, nil
|
||||
}
|
||||
|
||||
// foo.go:
|
||||
|
||||
@@ -11,10 +11,10 @@ import (
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func inject(context3 context2.Context, arg struct{}) (context, error) {
|
||||
context4, err := provide(context3)
|
||||
func inject(contextContext context2.Context, arg struct{}) (context, error) {
|
||||
mainContext, err := provide(contextContext)
|
||||
if err != nil {
|
||||
return context{}, err
|
||||
}
|
||||
return context4, nil
|
||||
return mainContext, nil
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
func injectFooBar() FooBar {
|
||||
foo := provideFoo()
|
||||
bar2 := bar.ProvideBar()
|
||||
fooBar := provideFooBar(foo, bar2)
|
||||
barBar := bar.ProvideBar()
|
||||
fooBar := provideFooBar(foo, barBar)
|
||||
return fooBar
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user