Sha256: dfcbab9bdef16462e6c789595e38dae1aebfe87885e009877235ce686859724d
Contents?: true
Size: 484 Bytes
Versions: 16
Compression:
Stored size: 484 Bytes
Contents
package keyring import ( "os" "path/filepath" "strings" ) var tildePrefix = string([]rune{'~', filepath.Separator}) // ExpandTilde will expand tilde (~/ or ~\ depending on OS) for the user home directory. func ExpandTilde(dir string) (string, error) { if strings.HasPrefix(dir, tildePrefix) { homeDir, err := os.UserHomeDir() if err != nil { return "", err } dir = strings.Replace(dir, "~", homeDir, 1) debugf("Expanded file dir to %s", dir) } return dir, nil }
Version data entries
16 entries across 16 versions & 1 rubygems