(path string, index int)
| 400 | } |
| 401 | |
| 402 | func browseRootLabel(path string, index int) string { |
| 403 | cleaned := filepath.Clean(path) |
| 404 | root := filesystemRootForPath(cleaned) |
| 405 | if cleaned == root { |
| 406 | return "Mounted Root" |
| 407 | } |
| 408 | base := filepath.Base(cleaned) |
| 409 | if base == "." || base == string(filepath.Separator) || strings.TrimSpace(base) == "" { |
| 410 | return "Mounted Root" |
| 411 | } |
| 412 | if index == 0 { |
| 413 | return base |
| 414 | } |
| 415 | return base |
| 416 | } |
| 417 | |
| 418 | func defaultBrowsePath() string { |
| 419 | if home, err := os.UserHomeDir(); err == nil && strings.TrimSpace(home) != "" { |
no test coverage detected