// NormalizePath normalises path, evaluating symlinks and converting local
// paths to absolute
507764
func NormalizePath(path string) (string, error) {
	s, err := filepath.Abs(path)
	if err != nil {
		return "", trace.ConvertSystemError(err)
	}
	abs, err := filepath.EvalSymlinks(s)
	if err != nil {
		return "", trace.ConvertSystemError(err)
	}
	return abs, nil
}
1129970
func cleanPath(p string) string {
	p = filepath.ToSlash(p)
	if !filepath.IsAbs(p) {
		p = "/" + p
	}
	return path.Clean(p)
}
1206867
func Path(path string) p.Plugin {
	return p.NewRequestPlugin(func(ctx *c.Context, h c.Handler) {
		ctx.Request.URL.Path = normalizePath(path)
		h.Next(ctx)
	})
}
665325
func (ut *URLTransformer) LoadPath(path string) error {
	path = ut.rxStripQuery.ReplaceAllString(path, "")
	i1 := strings.Index(path, "{")
	i2 := strings.Index(path, "}")
	if i1 < 0 && i2 < 0 {
		ut.ExactPaths = append(ut.ExactPaths, path)
		return nil
	}
	linkPattern := ut.rxMatchPattern.ReplaceAllString(path, rxMatchParameterActual)
	linkPattern = `^` + linkPattern + `$`
	rx, err := regexp.Compile(linkPattern)
	if err != nil {
		return err
	}
	ut.RegexpPaths[path] = rx
	return nil
}
822157
func (o *Options) Path() string {
	switch {
	case o.LibPath != "":
		return o.LibPath

	case o.LoadDefault == MIT:
		return appendOSExt("libgssapi_krb5")

	case o.LoadDefault == Heimdal:
		return appendOSExt("libgssapi")
	}
	return ""
}
803008
func LocalConfigDirectoryAbsolutePath() (string, error) {
	root, err := gitutil.RepositoryRootAbsolutePath()
	if err != nil {
		return "", err
	}
	return filepath.Join(root, LocalConfigDirname), nil
}
24725
func (p *File_Template_Parameter) Normalize() error {
	if p == nil {
		return errors.New("is nil")
	}
	if err := p.Schema.Normalize(); err != nil {
		return fmt.Errorf("schema: %s", err)
	}
	if p.Default != nil {
		if err := p.Default.Normalize(); err != nil {
			return fmt.Errorf("default value: %s", err)
		}
		if err := p.Accepts(p.Default); err != nil {
			return fmt.Errorf("default value: %s", err)
		}
	}
	return nil
}
405615
func (a *ReverseNestedAggregation) Path(path string) *ReverseNestedAggregation {
	a.path = path
	return a
}
1171495
func LocalConfigFileAbsolutePath() (string, error) {
	configDir, err := LocalConfigDirectoryAbsolutePath()
	if err != nil {
		return "", err
	}
	return filepath.Join(configDir, LocalConfigFilename), nil
}
1086766
func expandPath(s string) string {
	if s == "" {
		return ""
	}

	e, err := homedir.Expand(s)
	if err != nil {
		return s
	}
	return e
}
120329
func (f *File) Normalize() error {
	for tempName, t := range f.Template {
		if err := t.Normalize(); err != nil {
			return fmt.Errorf("template %q: %s", tempName, err)
		}
	}
	return nil
}
724605
func ResolvePath(path string, base string) string {
	// Don't resolve empty paths
	if len(path) > 0 {
		// Don't resolve absolute paths
		if !filepath.IsAbs(path) {
			return filepath.Join(base, path)
		}
	}

	return path
}
1225876
func (env *EnvironmentItemModel) Normalize() error {
	opts, err := env.GetOptions()
	if err != nil {
		return err
	}
	(*env)[OptionsKey] = opts
	return nil
}
473144
func (p *CipdPackage) Normalize() error {
	if p.Name == "" {
		return errors.New("missing name")
	}
	if p.Version == "" {
		return errors.New("missing version")
	}
	return nil
}
458808
func (i *LocalInstaller) Path() string {
	if i.Source == "" {
		return ""
	}
	return filepath.Join(i.Home.Rigs(), i.Name)
}
1333979
func ExpandPath(f string) (string, error) {
	if !path.IsAbs(f) {
		wd, err := os.Getwd()
		if err != nil {
			return "", err
		}
		fname := path.Clean(path.Join(wd, f))
		return fname, nil
	}

	return f, nil
}
752073
func (a *Attribute) normalizeKey(relative string) string {
	return strings.Join([]string{a.Section, relative}, ".")
}