list.go
func (l *List) Enumerate(cancel <-chan struct{}) Enumerator {
	retval := make(chan interface{})

	go func() {
		l.key.RLock()
		defer l.key.RUnlock()
		defer close(retval)

		for _, entry := range l.underlyer {
			select {
			case retval <- entry:
				break
			case <-cancel:
				return
			}
		}
	}()

	return retval
}
func (l *List) Enumerate(cancel <-chan struct{}) Enumerator {
	retval := make(chan interface{})

	go func() {
		l.key.RLock()
		defer l.key.RUnlock()
		defer close(retval)

		for _, entry := range l.underlyer {
			select {
			case retval <- entry:
				break
			case <-cancel:
				return
			}
		}
	}()

	return retval
}
func ( l * List ) Enumerate ( cancel <- chan struct { } ) Enumerator { retval := make ( chan interface { } ) go func ( ) { l . key . RLock ( ) defer l . key . RUnlock ( ) defer close ( retval ) for _ , entry := range l . underlyer { select { case retval <- entry : break case <- cancel : return } } } ( ) return retval }
// Enumerate lists each element present in the collection
Enumerate lists each element present in the collection