fix fbs encoding
This commit is contained in:
@ -545,6 +545,8 @@ type chanIter[T any] struct {
|
||||
next T
|
||||
}
|
||||
|
||||
var errChannelClosed = errors.New("channel closed")
|
||||
|
||||
func (i *chanIter[T]) Next() (ok bool) {
|
||||
if i.err != nil {
|
||||
return false
|
||||
@ -552,7 +554,7 @@ func (i *chanIter[T]) Next() (ok bool) {
|
||||
|
||||
i.next, ok = <-i.in
|
||||
if !ok {
|
||||
i.err = errors.New("channel closed")
|
||||
i.err = errChannelClosed
|
||||
}
|
||||
|
||||
return ok
|
||||
@ -563,6 +565,10 @@ func (i *chanIter[T]) Get() T {
|
||||
}
|
||||
|
||||
func (i *chanIter[T]) Err() error {
|
||||
if errors.Is(i.err, errChannelClosed) {
|
||||
return nil
|
||||
}
|
||||
|
||||
return i.err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user