mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
fa095e4b4f
* fix(doc): fix go playground demo URL * fix(doc): add more go playground demo URL
638 B
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 |
|
|
https://go.dev/play/p/ktE4IMXDMxv |
|
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