func newMainService(mainConfig MainConfig) *MainService {
	config := mainConfig.Foo
	service := foo.New(config)
	barConfig := mainConfig.Bar
	barService := bar.New(barConfig, service)
	bazConfig := mainConfig.baz
	bazService := baz.New(bazConfig, barService)
	mainService := &MainService{
		Foo: service,
		Bar: barService,
		baz: bazService,
	}
	return mainService
}
Injectors from wire.go:
package main
import (
	"example.com/bar"
	"example.com/baz"
	"example.com/foo"
	"fmt"
)