// Resolve a type into a list of values by resolving all defined pointers with that exact type
184000
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
}
1100154
func resolveType(r ActionInterface) ActionInterface {
	ax, ad := UnwrapAny(r)

	if ax != nil {
		return ax
	}

	if ad != nil {
		xa := NewAction()
		ad.When(func(x interface{}, _ ActionInterface) {
			xa.Fullfill(x)
		})
		return xa
	}

	return r
}
158022
func (r *Resolver) ResolveAllPlatforms(ctx context.Context, file *ensure.File) (map[template.Platform]*ensure.ResolvedFile, error) {
	logging.Debugf(ctx, "Resolving for %d platform(s) in the ensure file...", len(file.VerifyPlatforms))

	r.Client.BeginBatch(ctx)
	defer r.Client.EndBatch(ctx)

	type resolvedOrErr struct {
		resolved *ensure.ResolvedFile
		err      error
	}
	results := make([]resolvedOrErr, len(file.VerifyPlatforms))

	// Note: errors are reported through 'results'.
	parallel.FanOutIn(func(tasks chan<- func() error) {
		for idx, plat := range file.VerifyPlatforms {
			idx := idx
			plat := plat
			tasks <- func() error {
				ret, err := r.Resolve(ctx, file, plat.Expander())
				results[idx] = resolvedOrErr{ret, err}
				return nil
			}
		}
	})

	// Collect all errors into a flat MultiError list sorted by platform.
	out := make(map[template.Platform]*ensure.ResolvedFile, len(results))
	var merr errors.MultiError
	for idx, plat := range file.VerifyPlatforms {
		err := results[idx].err
		if err == nil {
			out[plat] = results[idx].resolved
			continue
		}
		if me, ok := err.(errors.MultiError); ok {
			for _, err := range me {
				merr = append(merr, fmt.Errorf("when resolving %s - %s", plat, err))
			}
		} else {
			merr = append(merr, fmt.Errorf("when resolving %s - %s", plat, err))
		}
	}
	if len(merr) != 0 {
		return nil, merr
	}
	return out, nil
}
798132
func (pv PlanValue) ResolveList(bindVars map[string]*querypb.BindVariable) ([]Value, error) {
	switch {
	case pv.ListKey != "":
		bv, err := pv.lookupList(bindVars)
		if err != nil {
			return nil, err
		}
		values := make([]Value, 0, len(bv.Values))
		for _, val := range bv.Values {
			values = append(values, MakeTrusted(val.Type, val.Value))
		}
		return values, nil
	case pv.Values != nil:
		values := make([]Value, 0, len(pv.Values))
		for _, val := range pv.Values {
			v, err := val.ResolveValue(bindVars)
			if err != nil {
				return nil, err
			}
			values = append(values, v)
		}
		return values, nil
	}
	// This code is unreachable because the parser does not allow
	// single value constructs where multiple values are expected.
	return nil, vterrors.New(vtrpcpb.Code_INVALID_ARGUMENT, "a single value was supplied where a list was expected")
}
1077564
func (parser *SourceParser) Resolve(param string) string {
	if param == imageserver_source.Param {
		return imageserver_source.Param
	}
	return ""
}
543621
func (nsr *NamespaceResolver) ResolveType(n node.Node) {
	switch nn := n.(type) {
	case *node.Nullable:
		nsr.ResolveType(nn.Expr)
	case name.Names:
		nsr.ResolveName(n, "")
	}
}
268398
func (d DestinationShards) Resolve(allShards []*topodatapb.ShardReference, addShard func(shard string) error) error {
	for _, shard := range d {
		if err := addShard(shard); err != nil {
			return err
		}
	}
	return nil
}
194896
func (p *baseLogicalPlan) ResolveIndicesAndCorCols() {
	for _, child := range p.children {
		child.(LogicalPlan).ResolveIndicesAndCorCols()
	}
}
340262
func ResolveScopeList(ctx context.Context, scopeList string) []auth.Access {
	scopes := strings.Split(scopeList, " ")
	return ResolveScopeSpecifiers(ctx, scopes)
}
1287894
func (d DestinationKeyRange) Resolve(allShards []*topodatapb.ShardReference, addShard func(shard string) error) error {
	return processKeyRange(allShards, d.KeyRange, addShard)
}
968787
func (m *Parameter) ResolveReferences(root string) (interface{}, error) {
	errors := make([]error, 0)
	if m.Schema != nil {
		_, err := m.Schema.ResolveReferences(root)
		if err != nil {
			errors = append(errors, err)
		}
	}
	if m.Example != nil {
		_, err := m.Example.ResolveReferences(root)
		if err != nil {
			errors = append(errors, err)
		}
	}
	if m.Examples != nil {
		_, err := m.Examples.ResolveReferences(root)
		if err != nil {
			errors = append(errors, err)
		}
	}
	if m.Content != nil {
		_, err := m.Content.ResolveReferences(root)
		if err != nil {
			errors = append(errors, err)
		}
	}
	for _, item := range m.SpecificationExtension {
		if item != nil {
			_, err := item.ResolveReferences(root)
			if err != nil {
				errors = append(errors, err)
			}
		}
	}
	return nil, compiler.NewErrorGroupOrNil(errors)
}
53943
func (m *MockInterface) Resolve(arg0 *charm_v6.URL) (*charm_v6.URL, []string, error) {
	ret := m.ctrl.Call(m, "Resolve", arg0)
	ret0, _ := ret[0].(*charm_v6.URL)
	ret1, _ := ret[1].([]string)
	ret2, _ := ret[2].(error)
	return ret0, ret1, ret2
}
444972
func (m *ParameterOrReference) ResolveReferences(root string) (interface{}, error) {
	errors := make([]error, 0)
	{
		p, ok := m.Oneof.(*ParameterOrReference_Parameter)
		if ok {
			_, err := p.Parameter.ResolveReferences(root)
			if err != nil {
				return nil, err
			}
		}
	}
	{
		p, ok := m.Oneof.(*ParameterOrReference_Reference)
		if ok {
			_, err := p.Reference.ResolveReferences(root)
			if err != nil {
				return nil, err
			}
		}
	}
	return nil, compiler.NewErrorGroupOrNil(errors)
}
843666
func (sr *StaticResolver) Resolve(ctx context.Context) (string, connect.CertURI, error) {
	return sr.Addr, sr.CertURI, nil
}
298726
func (m *Link) ResolveReferences(root string) (interface{}, error) {
	errors := make([]error, 0)
	if m.Parameters != nil {
		_, err := m.Parameters.ResolveReferences(root)
		if err != nil {
			errors = append(errors, err)
		}
	}
	if m.RequestBody != nil {
		_, err := m.RequestBody.ResolveReferences(root)
		if err != nil {
			errors = append(errors, err)
		}
	}
	if m.Server != nil {
		_, err := m.Server.ResolveReferences(root)
		if err != nil {
			errors = append(errors, err)
		}
	}
	for _, item := range m.SpecificationExtension {
		if item != nil {
			_, err := item.ResolveReferences(root)
			if err != nil {
				errors = append(errors, err)
			}
		}
	}
	return nil, compiler.NewErrorGroupOrNil(errors)
}
501434
func (m *Protocols) ResolveReferences(root string) (interface{}, error) {
	errors := make([]error, 0)
	if m.Simple != nil {
		_, err := m.Simple.ResolveReferences(root)
		if err != nil {
			errors = append(errors, err)
		}
	}
	if m.Resumable != nil {
		_, err := m.Resumable.ResolveReferences(root)
		if err != nil {
			errors = append(errors, err)
		}
	}
	return nil, compiler.NewErrorGroupOrNil(errors)
}
525066
func (n *Node) Resolve(path []string) (interface{}, []string, error) {
	var cur interface{} = n.obj
	for i, val := range path {
		switch curv := cur.(type) {
		case map[string]interface{}:
			next, ok := curv[val]
			if !ok {
				return nil, nil, ErrNoSuchLink
			}

			cur = next
		case map[interface{}]interface{}:
			next, ok := curv[val]
			if !ok {
				return nil, nil, ErrNoSuchLink
			}

			cur = next
		case []interface{}:
			n, err := strconv.Atoi(val)
			if err != nil {
				return nil, nil, err
			}

			if n < 0 || n >= len(curv) {
				return nil, nil, ErrArrayOutOfRange
			}

			cur = curv[n]
		case cid.Cid:
			return &node.Link{Cid: curv}, path[i:], nil
		default:
			return nil, nil, ErrNoLinks
		}
	}

	lnk, ok := cur.(cid.Cid)
	if ok {
		return &node.Link{Cid: lnk}, nil, nil
	}

	jsonish, err := convertToJSONIsh(cur)
	if err != nil {
		return nil, nil, err
	}

	return jsonish, nil, nil
}