diff --git a/goextVersion.go b/goextVersion.go index 877bc86..f64c7a9 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.561" +const GoextVersion = "0.0.562" -const GoextVersionTimestamp = "2025-01-29T11:02:41+0100" +const GoextVersionTimestamp = "2025-01-29T11:24:20+0100" diff --git a/wmo/queryFind.go b/wmo/queryFind.go index 253699f..16c084d 100644 --- a/wmo/queryFind.go +++ b/wmo/queryFind.go @@ -114,7 +114,7 @@ func (c *Coll[TData]) FindIterateFunc(ctx context.Context, filter bson.M, fn fun func (c *Coll[TData]) FindIterate(ctx context.Context, filter bson.M, opts ...*options.FindOptions) iter.Seq2[TData, error] { cursor, err := c.createFindQuery(ctx, filter, opts...) if err != nil { - return langext.IterSingleValueSeq2[TData, error](nil, exerr.Wrap(err, "").Build()) + return langext.IterSingleValueSeq2[TData, error](*new(TData), exerr.Wrap(err, "").Build()) } return func(yield func(TData, error) bool) { @@ -123,7 +123,7 @@ func (c *Coll[TData]) FindIterate(ctx context.Context, filter bson.M, opts ...*o for cursor.Next(ctx) { v, err := c.decodeSingle(ctx, cursor) if err != nil { - if !yield(nil, err) { + if !yield(*new(TData), err) { return } continue diff --git a/wmo/queryList.go b/wmo/queryList.go index 4d17c0c..0b5b338 100644 --- a/wmo/queryList.go +++ b/wmo/queryList.go @@ -76,15 +76,15 @@ func (c *Coll[TData]) ListIterate(ctx context.Context, filter ct.Filter, pageSiz if ctks, ok := inTok.(ct.CTKeySort); ok { _, _, _, _, cursor, err = c.createKSListQuery(ctx, filter, pageSize, ctks) if err != nil { - return langext.IterSingleValueSeq2[TData, error](nil, exerr.Wrap(err, "").Build()) + return langext.IterSingleValueSeq2[TData, error](*new(TData), exerr.Wrap(err, "").Build()) } } else if ctpag, ok := inTok.(ct.CTPaginated); ok { _, cursor, err = c.createPaginatedListQuery(ctx, filter, pageSize, ctpag) if err != nil { - return langext.IterSingleValueSeq2[TData, error](nil, exerr.Wrap(err, "").Build()) + return langext.IterSingleValueSeq2[TData, error](*new(TData), exerr.Wrap(err, "").Build()) } } else { - return langext.IterSingleValueSeq2[TData, error](nil, exerr.New(exerr.TypeCursorTokenDecode, "unknown ct type").Any("token", inTok).Type("tokenType", inTok).Build()) + return langext.IterSingleValueSeq2[TData, error](*new(TData), exerr.New(exerr.TypeCursorTokenDecode, "unknown ct type").Any("token", inTok).Type("tokenType", inTok).Build()) } return func(yield func(TData, error) bool) { @@ -93,7 +93,7 @@ func (c *Coll[TData]) ListIterate(ctx context.Context, filter ct.Filter, pageSiz for cursor.Next(ctx) { v, err := c.decodeSingle(ctx, cursor) if err != nil { - if !yield(nil, err) { + if !yield(*new(TData), err) { return } continue diff --git a/wmo/queryPaginate.go b/wmo/queryPaginate.go index b5b356d..ebad579 100644 --- a/wmo/queryPaginate.go +++ b/wmo/queryPaginate.go @@ -87,7 +87,7 @@ func (c *Coll[TData]) PaginateIterateFunc(ctx context.Context, filter pag.MongoF func (c *Coll[TData]) PaginateIterate(ctx context.Context, filter pag.MongoFilter, page int, limit *int) iter.Seq2[TData, error] { page, cursor, _, err := c.createPaginatedQuery(ctx, filter, page, limit) if err != nil { - return langext.IterSingleValueSeq2[TData, error](nil, exerr.Wrap(err, "").Build()) + return langext.IterSingleValueSeq2[TData, error](*new(TData), exerr.Wrap(err, "").Build()) } return func(yield func(TData, error) bool) { @@ -96,7 +96,7 @@ func (c *Coll[TData]) PaginateIterate(ctx context.Context, filter pag.MongoFilte for cursor.Next(ctx) { v, err := c.decodeSingle(ctx, cursor) if err != nil { - if !yield(nil, err) { + if !yield(*new(TData), err) { return } continue