Files
lo/docs/data/it-isempty.md
T
2025-10-08 19:35:53 +02:00

679 B

name, slug, sourceRef, category, subCategory, signatures, playUrl, variantHelpers, similarHelpers, position
name slug sourceRef category subCategory signatures playUrl variantHelpers similarHelpers position
IsEmpty isempty it/type_manipulation.go#L50 it type
func IsEmpty[T any](collection iter.Seq[T]) bool
https://go.dev/play/p/F6gG2iI9Cd4
it#type#isempty
it#type#isnotempty
it#type#empty
it#sequence#length
10

Returns true if the sequence is empty. Will consume the entire sequence to check.

Examples:

seq := func(yield func(int) bool) {
    // empty sequence
}
empty := it.IsEmpty(seq)
// empty == true
seq := func(yield func(int) bool) {
    _ = yield(1)
    _ = yield(2)
}
empty := it.IsEmpty(seq)
// empty == false