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

27 lines
482 B
Markdown

---
name: Drain
slug: drain
sourceRef: it/seq.go#L26
category: it
subCategory: sequence
signatures:
- "func Drain[T any](collection iter.Seq[T])"
playUrl: https://go.dev/play/p/xU_GCG861r1
variantHelpers: []
similarHelpers: []
position: 170
---
Drain consumes an entire sequence.
```go
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
```