func (g *graph) ResolveByType(ptrType reflect.Type) []reflect.Value {
	var values []reflect.Value
	for ptr, def := range g.definitions {
		if reflect.TypeOf(ptr).Elem() == ptrType {
			values = append(values, def.Resolve(g))
		}
	}
	return values
}
Resolve a type into a list of values by resolving all defined pointers with that exact type
package inject
import (
	"fmt"
	"reflect"
	"sort"
)
type Graph interface {
	Finalizable
	Add(Definition)
	Define(ptr interface{}, provider Provider) Definition
	Resolve(ptr interface{}) reflect.Value
	ResolveByType(ptrType reflect.Type) []reflect.Value
	ResolveByAssignableType(ptrType reflect.Type) []reflect.Value
	ResolveAll() []reflect.Value
	fmt.Stringer
}
type graph struct {
	definitions map[interface{}]Definition
}
func NewGraph(defs ...Definition) Graph {
	defMap := make(map[interface{}]Definition, len(defs))
	for _, def := range defs {
		defMap[def.Ptr()] = def
	}
	return &graph{
		definitions: defMap,
	}
}
func (g *graph) Add(def Definition) {
	g.definitions[def.Ptr()] = def
}
func (g *graph) Define(ptr interface{}, provider Provider) Definition {
	def := NewDefinition(ptr, provider)
	g.Add(def)
	return def
}
func (g *graph) Resolve(ptr interface{}) reflect.Value {
	ptrType := reflect.TypeOf(ptr)
	if ptrType.Kind() != reflect.Ptr {
		panic(fmt.Sprintf("ptr (%v) is not a pointer", ptrType))
	}
	ptrValueElem := reflect.ValueOf(ptr).Elem()
	def, found := g.definitions[ptr]
	if !found {
		return ptrValueElem
	}
	return def.Resolve(g)
}