query.go
func (iter Enumerator) Merge(others ...Enumerator) Enumerator {
	retval := make(chan interface{})

	var wg sync.WaitGroup
	wg.Add(len(others) + 1)

	funnel := func(prevResult Enumerator) {
		for entry := range prevResult {
			retval <- entry
		}
		wg.Done()
	}

	go funnel(iter)
	for _, item := range others {
		go funnel(item)
	}

	go func() {
		wg.Wait()
		close(retval)
	}()
	return retval
}
func (iter Enumerator) Merge(others ...Enumerator) Enumerator {
	retval := make(chan interface{})

	var wg sync.WaitGroup
	wg.Add(len(others) + 1)

	funnel := func(prevResult Enumerator) {
		for entry := range prevResult {
			retval <- entry
		}
		wg.Done()
	}

	go funnel(iter)
	for _, item := range others {
		go funnel(item)
	}

	go func() {
		wg.Wait()
		close(retval)
	}()
	return retval
}
func ( iter Enumerator ) Merge ( others ... Enumerator ) Enumerator { retval := make ( chan interface { } ) var wg sync . WaitGroup wg . Add ( len ( others ) + 1 ) funnel := func ( prevResult Enumerator ) { for entry := range prevResult { retval <- entry } wg . Done ( ) } go funnel ( iter ) for _ , item := range others { go funnel ( item ) } go func ( ) { wg . Wait ( ) close ( retval ) } ( ) return retval }
// Merge takes the results of this Enumerator and others, and funnels them into
// a single Enumerator. The order of in which they will be combined is non-deterministic.
Merge takes the results of this Enumerator and others and funnels them into a single Enumerator . The order of in which they will be combined is non - deterministic .