// GetPath checks if the path from the mounter is empty.
978886
func GetPath(mounter volume.Mounter) (string, error) {
	path := mounter.GetPath()
	if path == "" {
		return "", fmt.Errorf("Path is empty %s", reflect.TypeOf(mounter).String())
	}
	return path, nil
}
201076
func GetDiskPath(d *drivers.BaseDriver) string {
	return filepath.Join(d.ResolveStorePath("."), d.GetMachineName()+".rawdisk")
}
92010
func (container *Container) MountsResourcePath(mount string) (string, error) {
	return container.GetRootResourcePath(filepath.Join("mounts", mount))
}
784472
func (g *Graph) getPath(p *Graph) (*Graph, error) {

	if p.Len() == 0 || g == nil {
		return nil, ErrInvalidArgs
	}

	// fmt.Printf("%s\n", p.Show())

	ctx := g            // Current context node
	var ctxPrev *Graph  // Previous context node
	var elemPrev string // Previous path element searched in the context node

	for i := 0; i < len(p.Out); i++ {

		if ctx == nil {
			break
		}

		pathNode := p.Out[i]
		pathElement := pathNode.ThisString()

		switch pathElement {

		case TypeIndex:

			// must evaluate to an integer
			ix := pathNode.index(g)

			if ix < 0 {
				return nil, ErrInvalidIndex
			}

			r := New("[")
			r.Add(ctx.GetAt(ix))
			ctxPrev = ctx
			ctx = r

		case TypeSelector:

			if ctxPrev == nil || len(elemPrev) == 0 {
				return nil, ErrInvalidIndex
			}

			r := New("{")
			ix := pathNode.index(g) + 1 // 0 is {}, {n} becomes ix = n+1

			if ix < 0 {
				return nil, ErrInvalidIndex
			} else if ix == 0 {
				// This case is {}, thus return all ocurrences of the token just before
				r.addEqualNodes(ctxPrev, elemPrev, false)
			} else {
				// of all the nodes with name elemPrev, select the ix_th.
				for _, nn := range ctxPrev.Out {
					if nn.ThisString() == elemPrev {
						ix--
						if ix == 0 {
							r.AddNodes(nn)
							break
						}
					}
				}

			}
			ctxPrev = ctx
			ctx = r

		case TypeArguments:
			// We have hit an argument list of a function
			if ctx.Len() > 0 {
				itf, err := g.function(p, ctx.GetAt(0).This)
				if err != nil {
					return nil, err
				}
				var ok bool
				ctxPrev = ctx
				ctx, ok = itf.(*Graph)
				if !ok {
					return nil, ErrFunctionNoGraph
				}
			} else {
				return nil, ErrNotFound
			}

		case TypeGroup:
			// The expression is evaluated and used as path element
			itf, err := g.Eval(pathNode.Out[0])
			if err != nil {
				return nil, err
			}
			str := _string(itf)

			if len(str) == 0 {
				return nil, nil // expr does not evaluate to a string
			}
			pathElement = str
			// [!] .().
			fallthrough

		default:
			ctxPrev = ctx
			ctx = ctx.Node(pathElement)
			elemPrev = pathElement

			if ctx == nil {
				if ctxPrev.Len() > 0 {
					itf, err := g.function(p, ctxPrev.GetAt(0).This)
					if err != nil {
						return nil, err
					}
					var ok bool
					ctx, ok = itf.(*Graph)
					if !ok {
						return nil, ErrFunctionNoGraph
					}
				}
			}
		}
	}

	return ctx, nil
}
844278
func (m *MountPoint) Path() string {
	if m.Volume != nil {
		return m.Volume.Path()
	}
	return m.Source
}
919542
func GetModulePath(ctx context.Context) string {
	module := ctx.Value(moduleKey{})
	if module == nil {
		return ""
	}

	return module.(string)
}
1201503
func (c Config) GetWALPath(base string) string {
	if c.WALPath != "" {
		return c.WALPath
	}
	return filepath.Join(base, DefaultWALDirectoryName)
}
1268344
func (custom *GoCustomizations) getGoPath() (string, string) {
	fakeGoPath := filepath.Join(custom.paths.TmpDir, "gopath")
	if custom.Configuration.GoPath == "" {
		return fakeGoPath, fakeGoPath
	}
	return custom.Configuration.GoPath, fakeGoPath
}
352969
func (r *RepositoryComment) GetPath() string {
	if r == nil || r.Path == nil {
		return ""
	}
	return *r.Path
}
1117965
func (m *Mounter) GetSourcePath(mountPath string) (string, error) {
	m.Lock()
	defer m.Unlock()

	for k, v := range m.mounts {
		for _, p := range v.Mountpoint {
			if p.Path == mountPath {
				return k, nil
			}
		}
	}
	return "", ErrEnoent
}
1313174
func (pg *GoEvtxMap) GetString(path *GoEvtxPath) (string, error) {
	pE, err := pg.Get(path)
	if err != nil {
		return "", err
	}
	if s, ok := (*pE).(string); ok {
		return s, nil
	}
	return "", fmt.Errorf("Bad type expect string got %T", (*pE))
}
1001159
func (s *VolumeService) GetPathForVolume(p *GetPathForVolumeParams) (*GetPathForVolumeResponse, error) {
	resp, err := s.cs.newRequest("getPathForVolume", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r GetPathForVolumeResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
1348547
func (conf *Config) GetInitPath() string {
	conf.Lock()
	defer conf.Unlock()
	if conf.InitPath != "" {
		return conf.InitPath
	}
	if conf.DefaultInitBinary != "" {
		return conf.DefaultInitBinary
	}
	return DefaultInitBinary
}
863405
func (j *Json) GetPath(branch ...string) *Json {
	jin := j
	for _, p := range branch {
		jin = jin.Get(p)
	}
	return jin
}
69802
func (l *ActionListener) GetPath(nodes ...string) string {
	return actionPath(append([]string{l.hostID}, nodes...)...)
}
784492
func GetRequestPath(entity string, project string, id string) string {
	urlPath := ""

	if entity == "projects" {
		urlPath = urlPath + "/" + entity
	} else {
		urlPath = urlPath + "/projects/" + project + "/" + entity
	}

	if id != "" {
		if strings.HasPrefix(id, "?") {
			urlPath = urlPath + id
		} else {
			urlPath = urlPath + "/" + id
		}
	}

	return urlPath
}
794265
func (fi *fieldInfo) getField(a reflect.Value) reflect.Value {
	i := 0
	for ; i < len(fi.path)-1; i++ {
		a = indirect(a.Field(fi.path[i]))
	}
	return a.Field(fi.path[i])
}