diff --git a/models/utils/abstracts.go b/models/utils/abstracts.go index 496340e..8f8f0a8 100644 --- a/models/utils/abstracts.go +++ b/models/utils/abstracts.go @@ -204,7 +204,7 @@ func GenericLoadOne[T DBObject](id string, f func(DBObject) (DBObject, int, erro func genericLoadAll[T DBObject](res *mgb.Cursor, code int, err error, f func(DBObject) ShallowDBObject, a Accessor) ([]ShallowDBObject, int, error) { objs := []ShallowDBObject{} - results := []T{} + var results []T if err != nil { a.GetLogger().Error().Msg("Could not retrieve any from db. Error: " + err.Error()) return nil, code, err