mirror of
https://github.com/mainnika/mongox-go-driver.git
synced 2026-05-22 15:53:36 +00:00
Remove usesd ref interface from the stream loader
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user