Back to Lo

It Empty

docs/data/it-empty.md

1.53.0304 B
Original Source

Returns an empty sequence of the specified type.

Examples:

go
emptySeq := it.Empty[int]()
count := 0
for range emptySeq {
    count++
}
// count == 0
go
emptySeq := it.Empty[string]()
var result []string
for v := range emptySeq {
    result = append(result, v)
}
// result is empty slice