fix: initialize files as empty slice instead of nil var

var files []string marshals to JSON null, breaking the frontend
which expects an array. Using files := []string{} ensures [].
This commit is contained in:
2026-06-22 00:46:30 -07:00
parent b69e1d81ab
commit 371feaf0cb
+1 -1
View File
@@ -279,7 +279,7 @@ func handleListWavs(w http.ResponseWriter, r *http.Request) {
return return
} }
var files []string files := []string{}
for _, e := range entries { for _, e := range entries {
if !e.IsDir() && strings.HasSuffix(strings.ToLower(e.Name()), ".wav") { if !e.IsDir() && strings.HasSuffix(strings.ToLower(e.Name()), ".wav") {
files = append(files, e.Name()) files = append(files, e.Name())