(fragment string)
| 122 | } |
| 123 | |
| 124 | func splitPathFragment(fragment string) (string, string) { |
| 125 | if fragment == "" { |
| 126 | return "", "" |
| 127 | } |
| 128 | cleaned := filepath.Clean(fragment) |
| 129 | if strings.HasSuffix(fragment, "/") || strings.HasSuffix(fragment, `\`) { |
| 130 | return cleaned, "" |
| 131 | } |
| 132 | dir := filepath.Dir(fragment) |
| 133 | if dir == "." { |
| 134 | dir = "" |
| 135 | } |
| 136 | return dir, filepath.Base(fragment) |
| 137 | } |
| 138 | |
| 139 | func expandHome(path string) string { |
| 140 | if path == "~" { |
no outgoing calls
no test coverage detected