mirror of
https://github.com/samber/lo.git
synced 2026-04-23 16:40:17 +08:00
683 B
683 B
name, slug, sourceRef, category, subCategory, signatures, variantHelpers, similarHelpers, position
| name | slug | sourceRef | category | subCategory | signatures | variantHelpers | similarHelpers | position | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| FromSeqPtr | fromseqptr | it/type_manipulation.go#L11 | it | type |
|
|
|
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]