don't set np chan to nil
This commit is contained in:
parent
41130a2d5f
commit
a81f526cc6
@ -83,9 +83,9 @@ func (npr *nextPageResults[T]) NextPage() ([]T, bool, bool) {
|
|||||||
return nil, false, true
|
return nil, false, true
|
||||||
}
|
}
|
||||||
|
|
||||||
np := <-npr.pages
|
np, ok := <-npr.pages
|
||||||
|
|
||||||
return np.items, np.reset, false
|
return np.items, np.reset, !ok
|
||||||
}
|
}
|
||||||
|
|
||||||
func (npr *nextPageResults[T]) Results() (DeltaUpdate, error) {
|
func (npr *nextPageResults[T]) Results() (DeltaUpdate, error) {
|
||||||
@ -101,8 +101,9 @@ func (npr *nextPageResults[T]) Results() (DeltaUpdate, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (npr *nextPageResults[T]) close() {
|
func (npr *nextPageResults[T]) close() {
|
||||||
close(npr.pages)
|
if npr.pages != nil {
|
||||||
npr.pages = nil
|
close(npr.pages)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user