fix: return empty arrays instead of null in listPartitions, listVolumes, handleDiskVolumes

This commit is contained in:
2026-06-22 04:52:55 -07:00
parent 190c79487f
commit ebce8fded8
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -82,7 +82,7 @@ func listPartitions(isoPath string) ([]string, error) {
}
re := regexp.MustCompile(`^\s+([A-Z])\s+`)
var parts []string
parts := []string{}
for _, line := range strings.Split(out, "\n") {
if m := re.FindStringSubmatch(line); m != nil {
parts = append(parts, m[1])
@@ -110,7 +110,7 @@ func listVolumes(isoPath string, partitions []string) ([]volInfo, error) {
rePrompt := regexp.MustCompile(`/disk0/([A-Z])\s*>`)
reEntry := regexp.MustCompile(`^\s+\d+\s+(.+?)\s+-\s+`)
var vols []volInfo
vols := []volInfo{}
currentPart := ""
for _, line := range strings.Split(out, "\n") {