// Resolve returns a dummy ComponentMatch for any value input.
193504
func (r PipelineResolver) Resolve(value string) (*ComponentMatch, error) {
	return &ComponentMatch{
		Value:     value,
		LocalOnly: true,
	}, nil
}
49047
func (section *Section) Resolve(name string) (Value, error) {
	// Used only in error state return value
	var value Value

	parts := strings.Split(name, ".")
	if len(parts) == 0 {
		return value, errors.New("no name provided")
	}

	var current Value
	current = section
	for _, part := range parts {
		if current.GetType() != SECTION {
			return value, errors.New("trying to resolve value from non-section")
		}

		nextCurrent, err := current.(*Section).Get(part)
		if err != nil {
			return value, errors.New("could not find value in section")
		}
		current = nextCurrent
	}
	return current, nil
}
482027
func (spec DirectorySpec) Resolve(path ...string) string {
	return spec.Deps.Join(append([]string{spec.Dirname}, path...)...)
}
1065615
func (prs *ResizeParser) Resolve(param string) string {
	if !strings.HasPrefix(param, resizeParam+".") {
		return ""
	}
	return strings.TrimPrefix(param, resizeParam+".")
}
776124
func (api *NameAPI) Resolve(ctx context.Context, name string, opts ...caopts.NameResolveOption) (coreiface.Path, error) {
	results, err := api.Search(ctx, name, opts...)
	if err != nil {
		return nil, err
	}

	err = coreiface.ErrResolveFailed
	var p coreiface.Path

	for res := range results {
		p, err = res.Path, res.Err
		if err != nil {
			break
		}
	}

	return p, err
}
1158574
func (r HighestUniqueScoreResolver) Resolve(value string) (*ComponentMatch, error) {
	matches, err := r.Searcher.Search(true, value)
	sort.Sort(ScoredComponentMatches(matches))
	switch len(matches) {
	case 0:
		return nil, ErrNoMatch{Value: value, Errs: err, Type: r.Searcher.Type()}
	case 1:
		return matches[0], errors.NewAggregate(err)
	default:
		if matches[0].Score == matches[1].Score {
			equal := ComponentMatches{}
			for _, m := range matches {
				if m.Score != matches[0].Score {
					break
				}
				equal = append(equal, m)
			}
			return nil, ErrMultipleMatches{Value: value, Matches: equal, Errs: err}
		}
		return matches[0], errors.NewAggregate(err)
	}
}
617965
func (b *Box) Resolve(key string) (file.File, error) {
	key = strings.TrimPrefix(key, "/")

	var r resolver.Resolver

	b.resolvers.Range(func(k string, vr resolver.Resolver) bool {
		lk := strings.ToLower(resolver.Key(k))
		lkey := strings.ToLower(resolver.Key(key))
		if lk == lkey {
			r = vr
			return false
		}
		return true
	})

	if r == nil {
		r = b.DefaultResolver
		if r == nil {
			r = resolver.DefaultResolver
			if r == nil {
				return nil, errors.New("resolver.DefaultResolver is nil")
			}
		}
	}
	plog.Debug(r, "Resolve", "box", b.Name, "key", key)

	f, err := r.Resolve(b.Name, key)
	if err != nil {
		z := filepath.Join(resolver.OsPath(b.ResolutionDir), resolver.OsPath(key))
		f, err = r.Resolve(b.Name, z)
		if err != nil {
			plog.Debug(r, "Resolve", "box", b.Name, "key", z, "err", err)
			return f, err
		}
		b, err := ioutil.ReadAll(f)
		if err != nil {
			return f, err
		}
		f, err = file.NewFile(key, b)
		if err != nil {
			return f, err
		}
	}
	plog.Debug(r, "Resolve", "box", b.Name, "key", key, "file", f.Name())
	return f, nil
}
1109075
func (d DestinationExactKeyRange) Resolve(allShards []*topodatapb.ShardReference, addShard func(shard string) error) error {
	return processExactKeyRange(allShards, d.KeyRange, addShard)
}
935176
func (s constraintSolver) Solve(ctx sessionctx.Context, conditions []Expression) []Expression {
	exprs := newExprSet(ctx, conditions)
	s.fixPoint(ctx, exprs)
	return exprs.Slice()
}
843666
func (sr *StaticResolver) Resolve(ctx context.Context) (string, connect.CertURI, error) {
	return sr.Addr, sr.CertURI, nil
}
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
}
563264
func (r *dnsResolver) Resolve(target string) (Watcher, error) {
	host, port, err := parseTarget(target)
	if err != nil {
		return nil, err
	}

	if net.ParseIP(host) != nil {
		ipWatcher := &ipWatcher{
			updateChan: make(chan *Update, 1),
		}
		host, _ = formatIP(host)
		ipWatcher.updateChan <- &Update{Op: Add, Addr: host + ":" + port}
		return ipWatcher, nil
	}

	ctx, cancel := context.WithCancel(context.Background())
	return &dnsWatcher{
		r:      r,
		host:   host,
		port:   port,
		ctx:    ctx,
		cancel: cancel,
		t:      time.NewTimer(0),
	}, nil
}
1041066
func (state *Runtime) Resolve(name string) reflect.Value {

	if name == "." {
		return state.context
	}

	sc := state.scope
	// try to resolve variables in the current scope
	vl, ok := sc.variables[name]
	// if not found walks parent scopes
	for !ok && sc.parent != nil {
		sc = sc.parent
		vl, ok = sc.variables[name]
	}

	// if not found check globals
	if !ok {
		state.set.gmx.RLock()
		vl, ok = state.set.globals[name]
		state.set.gmx.RUnlock()
		// not found check defaultVariables
		if !ok {
			vl, ok = defaultVariables[name]
		}
	}
	return vl
}
377806
func (r *IDResolver) Resolve(ctx context.Context, t interface{}, id string) (string, error) {
	if r.noResolve {
		return id, nil
	}
	if name, ok := r.cache[id]; ok {
		return name, nil
	}
	name, err := r.get(ctx, t, id)
	if err != nil {
		return "", err
	}
	r.cache[id] = name
	return name, nil
}
399896
func (d DestinationAnyShard) Resolve(allShards []*topodatapb.ShardReference, addShard func(shard string) error) error {
	if len(allShards) == 0 {
		return vterrors.Errorf(vtrpcpb.Code_UNAVAILABLE, "no shard in keyspace")
	}
	return addShard(allShards[AnyShardPicker.PickShard(len(allShards))].Name)
}
1026029
func (p Pointer) Resolve(box string, path string) (file.File, error) {
	plog.Debug(p, "Resolve", "box", box, "path", path, "forward-box", p.ForwardBox, "forward-path", p.ForwardPath)
	b, err := findBox(p.ForwardBox)
	if err != nil {
		return nil, err
	}
	f, err := b.Resolve(p.ForwardPath)
	if err != nil {
		return f, errors.WithStack(errors.Wrap(err, path))
	}
	plog.Debug(p, "Resolve", "box", box, "path", path, "file", f)
	return file.NewFileR(path, f)
}
716206
func (t *Transaction) resolve(ctx context.Context) (*types.Transaction, error) {
	if t.tx == nil {
		tx, blockHash, _, index := rawdb.ReadTransaction(t.backend.ChainDb(), t.hash)
		if tx != nil {
			t.tx = tx
			t.block = &Block{
				backend:   t.backend,
				hash:      blockHash,
				canonical: unknown,
			}
			t.index = index
		} else {
			t.tx = t.backend.GetPoolTransaction(t.hash)
		}
	}
	return t.tx, nil
}