Remove usesd ref interface from the stream loader

This commit is contained in:
2021-03-08 08:19:44 +01:00
parent 80a5c864c5
commit 04382db4cd
2 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ func (d *Database) LoadStream(target interface{}, filters ...interface{}) (loade
return
}
loader = &StreamLoader{cur: cursor, ctx: ctx, ref: target, query: composed}
loader = &StreamLoader{cur: cursor, ctx: ctx, query: composed}
return
}
+1 -2
View File
@@ -13,7 +13,6 @@ type StreamLoader struct {
cur *mongox.Cursor
query *query.Query
ctx context.Context
ref interface{}
}
// DecodeNextMsg decodes the next document to an interface or returns an error
@@ -80,7 +79,7 @@ func (l *StreamLoader) Cursor() (cursor *mongox.Cursor) {
func (l *StreamLoader) Close() (err error) {
closerr := l.cur.Close(l.ctx)
invokerr := l.query.OnClose().Invoke(l.ctx, l.ref)
invokerr := l.query.OnClose().Invoke(l.ctx, nil)
if closerr != nil {
err = closerr