Files
lo/docs/data/it-drain.md
T
Samuel Berthe fa095e4b4f fix(doc): fix go playground demo URL (#832)
* fix(doc): fix go playground demo URL

* fix(doc): add more go playground demo URL
2026-03-06 00:09:59 +01:00

482 B

name, slug, sourceRef, category, subCategory, signatures, playUrl, variantHelpers, similarHelpers, position
name slug sourceRef category subCategory signatures playUrl variantHelpers similarHelpers position
Drain drain it/seq.go#L26 it sequence
func Drain[T any](collection iter.Seq[T])
https://go.dev/play/p/xU_GCG861r1
170

Drain consumes an entire sequence.

collection := func(yield func(int) bool) {
    yield(1)
    yield(2)
    yield(3)
    fmt.Println("yielding")
}

it.Drain(collection)
// prints "yielding" three times, sequence is consumed