func TwoFactory(dp dependency.Provider) (dependency.Instance, error) { two := NewTwo() if err := dp.InjectTo(two); err != nil { return nil, err } return two, nil }
func CircleFactory(dp dependency.Provider) (dependency.Instance, error) { ins := NewCircle() if err := dp.InjectTo(ins); err != nil { return nil, err } return ins, nil }
func MyCircleDepFactory(dp dependency.Provider) (dependency.Instance, error) { instance, err := dp.Get(MyCircleDepName) if err != nil { return nil, err } return &MyCircleDep{ instance: instance, }, nil }