(path string)
| 102 | } |
| 103 | |
| 104 | func expandHomeDirectory(path string) (string, error) { |
| 105 | if len(path) == 0 || path[0] != '~' { |
| 106 | return path, nil |
| 107 | } |
| 108 | |
| 109 | usr, err := user.Current() |
| 110 | if err != nil { |
| 111 | return "", err |
| 112 | } |
| 113 | return filepath.Join(usr.HomeDir, path[1:]), nil |
| 114 | } |
no outgoing calls
no test coverage detected