// Resolve follows a number of nameref variables, returning the last reference
// name that was followed and the variable that it points to.
333950
func (v Variable) Resolve(env Environ) (string, Variable) {
	name := ""
	for i := 0; i < maxNameRefDepth; i++ {
		if v.Kind != NameRef {
			return name, v
		}
		name = v.Str // keep name for the next iteration
		v = env.Get(name)
	}
	return name, Variable{}
}
1261673
func (parser *Parser) Resolve(param string) string {
	if !strings.HasPrefix(param, globalParam+".") {
		return ""
	}
	return strings.TrimPrefix(param, globalParam+".")
}
17716
func (ns NameSpace) resolve(path string) []mountedFS {
	path = ns.clean(path)
	for {
		if m := ns[path]; m != nil {
			if debugNS {
				fmt.Printf("resolve %s: %v\n", path, m)
			}
			return m
		}
		if path == "/" {
			break
		}
		path = pathpkg.Dir(path)
	}
	return nil
}
1037843
func (t *UDPv4) Resolve(n *enode.Node) *enode.Node {
	// If the node is present in the local table, no
	// network interaction is required.
	if intab := t.tab.Resolve(n); intab != nil {
		return intab
	}
	// Otherwise, do a network lookup.
	hash := n.ID()
	result := t.LookupPubkey(n.Pubkey())
	for _, n := range result {
		if n.ID() == hash {
			return n
		}
	}
	return nil
}
1131367
func (m *Reference) ResolveReferences(root string) (interface{}, error) {
	errors := make([]error, 0)
	if m.XRef != "" {
		info, err := compiler.ReadInfoForRef(root, m.XRef)
		if err != nil {
			return nil, err
		}
		return info, nil
	}
	return nil, compiler.NewErrorGroupOrNil(errors)
}
763630
func (r FirstMatchResolver) Resolve(value string) (*ComponentMatch, error) {
	matches, err := r.Searcher.Search(true, value)
	if len(matches) == 0 {
		return nil, ErrNoMatch{Value: value, Errs: err, Type: r.Searcher.Type()}
	}
	return matches[0], errors.NewAggregate(err)
}
1119577
func (w *WorklogClient) Resolve(ctx context.Context, orgID *identity.ID, ident *apitypes.WorklogID) error {
	return w.singleItemWorker(ctx, "POST", orgID, ident, nil)
}
894918
func (tab *Table) Resolve(n *enode.Node) *enode.Node {
	tab.mutex.Lock()
	cl := tab.closest(n.ID(), 1, false)
	tab.mutex.Unlock()
	if len(cl.entries) > 0 && cl.entries[0].ID() == n.ID() {
		return unwrapNode(cl.entries[0])
	}
	return nil
}
294388
func Resolve(zc ZK, key registry.Path, value string) (registry.Path, string, error) {
	// de-reference the pointer...
	switch {
	case strings.Index(value, PrefixEnv) == 0:
		p := value[len(PrefixEnv):]
		n, err := zc.Get(p)
		switch {
		case err == ErrNotExist:
			return key, "", nil
		case err != nil:
			return key, "", err
		}
		glog.Infoln("Resolving", key, "=", value, "==>", n.GetValueString())
		return Resolve(zc, key, n.GetValueString())
	case strings.Index(value, PrefixZk) == 0:
		p := value[len(PrefixZk):]
		n, err := zc.Get(p)
		switch {
		case err == ErrNotExist:
			return key, "", nil
		case err != nil:
			return key, "", err
		}
		glog.Infoln("Resolving", key, "=", value, "==>", n.GetValueString())
		return Resolve(zc, key, n.GetValueString())
	default:
		return key, value, nil
	}
}
202110
func (c *Client) ResolveReference(u *url.URL) *url.URL {
	absurl := c.Endpoint.ResolveReference(u)
	if len(c.Query) > 0 {
		absurl.RawQuery = mergeQueries(c.Query, absurl.Query())
	}
	return absurl
}
1106240
func (m *Server) ResolveReferences(root string) (interface{}, error) {
	errors := make([]error, 0)
	if m.Variables != nil {
		_, err := m.Variables.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)
}
1011910
func (r *referenceResolver) resolveReference(ref *ShapeRef) {
	if ref.ShapeName == "" {
		return
	}

	shape, ok := r.API.Shapes[ref.ShapeName]
	if !ok {
		panic(fmt.Sprintf("unable resolve reference, %s", ref.ShapeName))
	}

	if ref.JSONValue {
		ref.ShapeName = "JSONValue"
		if _, ok := r.API.Shapes[ref.ShapeName]; !ok {
			r.API.Shapes[ref.ShapeName] = &Shape{
				API:       r.API,
				ShapeName: "JSONValue",
				Type:      "jsonvalue",
				ValueRef: ShapeRef{
					JSONValue: true,
				},
			}
		}
	}

	ref.API = r.API   // resolve reference back to API
	ref.Shape = shape // resolve shape reference

	if r.visited[ref] {
		return
	}
	r.visited[ref] = true

	shape.refs = append(shape.refs, ref) // register the ref

	// resolve shape's references, if it has any
	r.resolveShape(shape)
}
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
}
482027
func (spec DirectorySpec) Resolve(path ...string) string {
	return spec.Deps.Join(append([]string{spec.Dirname}, path...)...)
}
893047
func (components ComponentReferences) Resolve() error {
	errs := []error{}
	for _, ref := range components {
		if err := ref.Resolve(); err != nil {
			errs = append(errs, err)
			continue
		}
	}
	return errors.NewAggregate(errs)
}
270037
func (m *Resource) ResolveReferences(root string) (interface{}, error) {
	errors := make([]error, 0)
	if m.Methods != nil {
		_, err := m.Methods.ResolveReferences(root)
		if err != nil {
			errors = append(errors, err)
		}
	}
	if m.Resources != nil {
		_, err := m.Resources.ResolveReferences(root)
		if err != nil {
			errors = append(errors, err)
		}
	}
	return nil, compiler.NewErrorGroupOrNil(errors)
}
793426
func (r *Repository) Reference(name plumbing.ReferenceName, resolved bool) (
	*plumbing.Reference, error) {

	if resolved {
		return storer.ResolveReference(r.Storer, name)
	}

	return r.Storer.Reference(name)
}