// ExpandTildeInPath converts ~ to $HOME
346282
func ExpandTildeInPath(s string) string {
	if strings.HasPrefix(s, "~") {
		return UserHomeDir() + s[1:]
	}
	return s
}
1027686
func (s *ValidateService) ExpandWildcards(expandWildcards string) *ValidateService {
	s.expandWildcards = expandWildcards
	return s
}
254498
func SplitPathDirEntry(path string) (dir, base string) {
	cleanedPath := filepath.Clean(normalizePath(path))

	if specifiesCurrentDir(path) {
		cleanedPath += string(filepath.Separator) + "."
	}

	return filepath.Dir(cleanedPath), filepath.Base(cleanedPath)
}
1321459
func (s *PutMappingService) ExpandWildcards(expandWildcards string) *PutMappingService {
	s.expandWildcards = expandWildcards
	return s
}
1237719
func (client *Client) SetIncludePaths(p []string) {
	client.mu.Lock()
	defer client.mu.Unlock()

	client.includePaths = p
}
1171495
func LocalConfigFileAbsolutePath() (string, error) {
	configDir, err := LocalConfigDirectoryAbsolutePath()
	if err != nil {
		return "", err
	}
	return filepath.Join(configDir, LocalConfigFilename), nil
}
191457
func (s *FieldCapsService) ExpandWildcards(expandWildcards string) *FieldCapsService {
	s.expandWildcards = expandWildcards
	return s
}
565173
func (s *IndicesSegmentsService) ExpandWildcards(expandWildcards string) *IndicesSegmentsService {
	s.expandWildcards = expandWildcards
	return s
}
1264138
func splitPath(path string) ([]fileInfo, error) {
	var mode os.FileMode
	fi, err := os.Stat(path)

	// If the path is not present in the host then we respond with the most
	// flexible permission.
	uid, gid := idUnsupported, idUnsupported
	if err != nil {
		mode = os.ModePerm
	} else {
		uid, gid = getOwner(fi)
		mode = fi.Mode()
	}
	var dirs []fileInfo
	dirs = append(dirs, fileInfo{Name: path, Perm: mode, Uid: uid, Gid: gid})
	currentDir := path
	for {
		dir := filepath.Dir(filepath.Clean(currentDir))
		if dir == currentDir {
			break
		}

		// We try to find the permission of the file in the host. If the path is not
		// present in the host then we respond with the most flexible permission.
		uid, gid := idUnsupported, idUnsupported
		fi, err := os.Stat(dir)
		if err != nil {
			mode = os.ModePerm
		} else {
			uid, gid = getOwner(fi)
			mode = fi.Mode()
		}
		dirs = append(dirs, fileInfo{Name: dir, Perm: mode, Uid: uid, Gid: gid})
		currentDir = dir
	}
	return dirs, nil
}
241066
func (s *IndicesGetService) ExpandWildcards(expandWildcards string) *IndicesGetService {
	s.expandWildcards = expandWildcards
	return s
}
209284
func (s *Sprocket) PushBackExtensionPath(ext, path string) (err error) {
	if path, err = filepath.Abs(path); err != nil {
		return
	}
	s.getOrCreateExtensionInfo(ext).Paths.PushBackUniq(path)
	return
}
1134487
func (s *IndicesUnfreezeService) ExpandWildcards(expandWildcards string) *IndicesUnfreezeService {
	s.expandWildcards = expandWildcards
	return s
}
199868
func homeExpand(homeDir, path string) string {
	if path == "" || path[0] != '~' || (len(path) > 1 && path[1] != os.PathSeparator) {
		return path
	}
	return filepath.Join(homeDir, path[1:])
}
782123
func Expand(u *url.URL, expansions map[string]string) {
	expanded, err := uritemplates.Expand(u.Path, expansions)
	if err == nil {
		u.Path = expanded
		SetOpaque(u)
	}
}
512944
func (a *appScanner) MustExpandPackagePath(packagePath string) string {
	pkgRealpath := swag.FindInGoSearchPath(packagePath)
	if pkgRealpath == "" {
		log.Fatalf("Can't find package %s \n", packagePath)
	}

	return pkgRealpath
}
168284
func ExpandHome(path string) string {
	if len(path) == 0 || path[0] != '~' {
		return path
	}

	u, _ := user.Current()

	return u.HomeDir + path[1:]
}
1116409
func (s *IndicesFlushService) ExpandWildcards(expandWildcards string) *IndicesFlushService {
	s.expandWildcards = expandWildcards
	return s
}