示例#1
0
func CircleFactory(dp dependency.Provider) (dependency.Instance, error) {
	ins := NewCircle()
	if err := dp.InjectTo(ins); err != nil {
		return nil, err
	}
	return ins, nil
}
示例#2
0
func TwoFactory(dp dependency.Provider) (dependency.Instance, error) {
	two := NewTwo()
	if err := dp.InjectTo(two); err != nil {
		return nil, err
	}
	return two, nil
}