Files
lo/docs/data/it-toanyseq.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

638 B

name, slug, sourceRef, category, subCategory, signatures, variantHelpers, playUrl, similarHelpers, position
name slug sourceRef category subCategory signatures variantHelpers playUrl similarHelpers position
ToAnySeq toanyseq it/type_manipulation.go#L11 it type
func ToAnySeq[T any](collection iter.Seq[T]) iter.Seq[any]
it#type#fromanyseq
https://go.dev/play/p/ktE4IMXDMxv
core#type#toany
243

ToAnySeq returns a sequence with all elements mapped to any type.

collection := func(yield func(int) bool) {
    yield(1)
    yield(2)
    yield(3)
}

anySeq := it.ToAnySeq(collection)
var result []any
for item := range anySeq {
    result = append(result, item)
}
// result contains [1, 2, 3] as any type