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
728 B
728 B
name, slug, sourceRef, category, subCategory, signatures, variantHelpers, playUrl, similarHelpers, position
| name | slug | sourceRef | category | subCategory | signatures | variantHelpers | playUrl | similarHelpers | position | |||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| FromSeqPtr | fromseqptr | it/type_manipulation.go#L11 | it | type |
|
|
https://go.dev/play/p/_eO6scpLcBF |
|
241 |
FromSeqPtr returns a sequence with the pointer values. Returns a zero value in case of a nil pointer element.
one := 1
two := 2
var three *int = nil
collection := func(yield func(*int) bool) {
yield(&one)
yield(&two)
yield(three)
}
values := it.FromSeqPtr(collection)
var result []int
for val := range values {
result = append(result, val)
}
// result contains [1, 2, 0]