mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
624 B
624 B
name, slug, sourceRef, category, subCategory, signatures, variantHelpers, similarHelpers, position
| name | slug | sourceRef | category | subCategory | signatures | variantHelpers | similarHelpers | position | ||
|---|---|---|---|---|---|---|---|---|---|---|
| FromSeqPtrOr | fromseqptror | it/type_manipulation.go#L11 | it | type |
|
|
242 |
FromSeqPtrOr returns a sequence with the pointer values or the fallback value.
one := 1
var two *int = nil
collection := func(yield func(*int) bool) {
yield(&one)
yield(two)
}
values := it.FromSeqPtrOr(collection, 99)
var result []int
for val := range values {
result = append(result, val)
}
// result contains [1, 99]