fix(quick-13): resolve lint issues in main source files

- Fix errcheck for db.Close() in testhelper.go
- Fix errcheck, nlreturn, wsl, gofumpt issues in genevents/main.go
- Fix gofumpt and wsl issues in library.go
This commit is contained in:
2026-03-05 14:07:50 -05:00
parent 97f256d67f
commit e1a95e65a9
12 changed files with 177 additions and 61 deletions
+9 -3
View File
@@ -16,6 +16,7 @@ type mockTrackLoader struct {
func (m *mockTrackLoader) LoadFile(filePath string) error {
m.loadedFile = filePath
return nil
}
@@ -53,7 +54,7 @@ func seedAudioFiles(t *testing.T, db *database.DB, count int) []string {
paths := make([]string, count)
for i := 0; i < count; i++ {
for i := range count {
recID := i + 1
afID := i + 1
fp := fmt.Sprintf("/test/track%d.mp3", i+1)
@@ -68,7 +69,9 @@ func seedAudioFiles(t *testing.T, db *database.DB, count int) []string {
}
_, err = db.ExecContext(
"INSERT OR IGNORE INTO audio_files (id, file_path, length_milliseconds, file_type_id, recording_id) VALUES (?, ?, 180000, 0, ?)",
"INSERT OR IGNORE INTO audio_files (id, file_path, "+
"length_milliseconds, file_type_id, recording_id) "+
"VALUES (?, ?, 180000, 0, ?)",
afID, fp, recID,
)
if err != nil {
@@ -292,7 +295,10 @@ func TestRemoveTrack_RemoveCurrentTrack(t *testing.T) {
// After removing currentIndex=2, index should be clamped to valid range.
if state.CurrentIndex < 0 || state.CurrentIndex >= len(state.Tracks) {
t.Errorf("currentIndex out of range: got %d, track count %d", state.CurrentIndex, len(state.Tracks))
t.Errorf(
"currentIndex out of range: got %d, track count %d",
state.CurrentIndex, len(state.Tracks),
)
}
}