// Path returns the absolute path of the primary directory, or an empty
// string if there's no suitable directory present.  This is the path
// that should be used for writing files.
489301
func (d Dir) Path() string {
	if d.env == "" {
		panic("xdgdir.Dir.Path() on zero Dir")
	}
	p := d.path()
	if p != "" && d.userOwned {
		info, err := os.Stat(p)
		if err != nil {
			return ""
		}
		if !info.IsDir() || info.Mode().Perm() != 0700 {
			return ""
		}
		st, ok := info.Sys().(*syscall.Stat_t)
		if !ok || int(st.Uid) != geteuid() {
			return ""
		}
	}
	return p
}
534909
func GoPath() string {
	if path := os.Getenv("GOPATH"); path != "" {
		return path
	}
	// https://github.com/golang/go/issues/17262
	return filepath.Join(os.Getenv("HOME"), "go")
}
646506
func (w *WebService) Path(root string) *WebService {
	w.rootPath = root
	if len(w.rootPath) == 0 {
		w.rootPath = "/"
	}
	w.compilePathExpression()
	return w
}
775672
func (r *Store) Path() string {
	if r.url == nil {
		return ""
	}
	return r.url.Path
}
970970
func (xmlNode *XmlNode) Path() (path string) {
	pathPtr := C.xmlGetNodePath(xmlNode.Ptr)
	if pathPtr != nil {
		p := (*C.char)(unsafe.Pointer(pathPtr))
		defer C.xmlFreeChars(p)
		path = C.GoString(p)
	}
	return
}
1255927
func (g *GopathTest) Path(pkg string) string {
	return filepath.Join(g.base, "src", pkg)
}
792958
func (r *ResponseMatcher) Path(p string) *ResponseMatcher {
	r.mux.mu.Lock()
	defer r.mux.mu.Unlock()
	r.path = p
	return r
}
1333624
func (c *Client) Path(path string) *Client {
	c.Use(url.Path(path))
	return c
}
129985
func (f *FileName) Path() string {
	cp := strings.Split(f.Name, "\x00")

	if len(cp) == 0 || cp[0] != serverPolicyRootShareName {
		return "" // TODO: not happening until if/when we handle Windows shares
	}

	cp[0] = ""

	return strings.Join(cp, "/")
}
10213
func (u *OfferURL) Path() string {
	var parts []string
	if u.User != "" {
		parts = append(parts, u.User)
	}
	if u.ModelName != "" {
		parts = append(parts, u.ModelName)
	}
	path := strings.Join(parts, "/")
	path = fmt.Sprintf("%s.%s", path, u.ApplicationName)
	if u.Source == "" {
		return path
	}
	return fmt.Sprintf("%s:%s", u.Source, path)
}
106931
func (b *RouteBuilder) Path(subPath string) *RouteBuilder {
	b.currentPath = subPath
	return b
}
202525
func (b *Boolean) Path(path string) *Value {
	return getPath(&b.chain, b.value, path)
}
182248
func (e Entry) Path() (string, error) {
	decodedName, err := govis.Unvis(e.Name, DefaultVisFlags)
	if err != nil {
		return "", err
	}
	decodedName = CleanPath(decodedName)
	if e.Parent == nil || e.Type == FullType {
		return decodedName, nil
	}
	parentName, err := e.Parent.Path()
	if err != nil {
		return "", err
	}
	return CleanPath(filepath.Join(parentName, decodedName)), nil
}
57365
func (d *driver) Path(
	ctx types.Context,
	volumeID, volumeName string,
	opts types.Store) (string, error) {

	ctx.WithFields(log.Fields{
		"volumeName": volumeName,
		"volumeID":   volumeID,
		"opts":       opts}).Info("getting path to volume")

	vol, err := d.volumeInspectByIDOrName(
		ctx, volumeID, volumeName, types.VolAttReqTrue, opts)
	if err != nil {
		return "", err
	} else if vol == nil {
		return "", utils.NewNotFoundError(
			fmt.Sprintf("volumeID=%s,volumeName=%s", volumeID, volumeName))
	}

	if len(vol.Attachments) == 0 {
		return "", nil
	}

	client := context.MustClient(ctx)

	mounts, err := client.OS().Mounts(
		ctx, vol.Attachments[0].DeviceName, "", opts)
	if err != nil {
		return "", err
	}

	if len(mounts) == 0 {
		return "", nil
	}

	volPath := d.volumeMountPath(mounts[0].MountPoint)

	ctx.WithFields(log.Fields{
		"volPath": volPath,
		"vol":     vol}).Info("returning path to volume")

	return volPath, nil
}
453662
func (e *V1Endpoint) Path(path string) string {
	return e.URL.String() + "/v1/" + path
}
526136
func FindInPath(binary string) (string, error) {
	pathEnv := os.Getenv("PATH")
	if len(pathEnv) == 0 {
		return "", errors.New("Found empty $PATH, not able to search $PATH")
	}

	for _, part := range strings.Split(pathEnv, ":") {
		if len(part) == 0 {
			continue
		}

		if found, err := FindInDirectory(binary, part); err != nil {
			return "", err
		} else if found {
			return path.Join(part, binary), nil
		}
	}

	return "", ErrBinaryNotFound
}
873714
func (v *Index) Path() string {
	ret := C.GoString(C.git_index_path(v.ptr))
	runtime.KeepAlive(v)
	return ret
}