data-cursor.go: fixed filter
This commit is contained in:
+2
-5
@@ -166,9 +166,8 @@ func (dc *dataCursor) filter(item any) (filterdItem any, err error) {
|
||||
|
||||
func (dc *dataCursor) Next() (item any, err error) { // must return io.EOF after the last item
|
||||
if dc.resource != nil {
|
||||
ctx := cloneContext(dc.ctx)
|
||||
// fmt.Printf("Entering Inner-Ctx [%p]: %s\n", ctx, CtxToString(ctx, 0))
|
||||
for item == nil && err == nil {
|
||||
ctx := cloneContext(dc.ctx)
|
||||
if item, err = dc.nextFunc.Invoke(ctx, nextName, []any{dc.resource}); err == nil {
|
||||
if item == nil {
|
||||
err = io.EOF
|
||||
@@ -177,10 +176,8 @@ func (dc *dataCursor) Next() (item any, err error) { // must return io.EOF after
|
||||
item, err = dc.filter(item)
|
||||
}
|
||||
}
|
||||
exportObjects(dc.ctx, ctx)
|
||||
}
|
||||
// fmt.Printf("Exiting Inner-Ctx [%p]: %s\n", ctx, CtxToString(ctx, 0))
|
||||
exportObjects(dc.ctx, ctx)
|
||||
// fmt.Printf("Outer-Ctx [%p]: %s\n", dc.ctx, CtxToString(dc.ctx, 0))
|
||||
} else {
|
||||
err = errInvalidDataSource()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user