Returning empty array instead of null if we don't have any movies to return.

This commit is contained in:
Maxime Delporte
2025-11-15 16:37:08 +01:00
parent 6fc5e725e6
commit 28b25fed6e

View File

@@ -227,7 +227,7 @@ func (m MovieModel) GetAll(title string, genres []string, filters Filters) ([]*M
defer rows.Close()
// Initialize an empty slice to hold the movie data.
var movies []*Movie
movies := []*Movie{}
// Use rows.Next to iterate through the rows in the resultset.
for rows.Next() {