node
comparableT
==!=comparable
type node[T comparable] struct {
    next *node[T]
    leaf T
}
nilTnil
T
var zero T
if n.leaf != zero {
    return n
}
comparable
any*T
anyleafTleaf
type node[T any] struct {
    next *node[T]
    leaf *T
}

func (n *node[T]) GetFirstNodeHasLeaf() *node[T] {
    if n.leaf != nil { // ok, leaf is a pointer type
        return n
    }
...
}
anyT
anyTnode
Tanynil
if !reflect.ValueOf(n.leaf).IsZero() {
    return n
}
TT
// leaf is an interface type
if !reflect.ValueOf(&n.leaf).Elem().IsZero() {
    return n
}