Returning empty array instead of null if we don't have any movies to return.
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user