func AppleZip2(in1, in2 <-chan Apple, out chan<- Apple) {
	closed2 := false
	for v := range in1 {
		out <- v
		v, ok := <-in2
		if ok {
			out <- v
		} else {
			closed2 = true
		}
	}
	// need to drain in2 as well?
	if !closed2 {
		for _ = range in2 {
		}
	}
	close(out)
}
// AppleZip2 interleaves two streams of Apple.
// Each input channel is used in turn, alternating between them.
// The function terminates when *both* input channels have been closed by their senders.
// The output channel is then closed also.
//
// It is part of the Plumbing function suite for Apple.
AppleZip2 interleaves two streams of Apple.
Each input channel is used in turn, alternating between them.
The function terminates when *both* input channels have been closed by their senders.
The output channel is then closed also.

It is part of the Plumbing function suite for Apple.
// AppleZip2 interleaves two streams of Apple . // Each input channel is used in turn alternating between them . // The function terminates when * both * input channels have been closed by their senders . // The output channel is then closed also . // // It is part of the Plumbing function suite for Apple .
func AppleZip2(in1, in2 <-chan Apple, out chan<- Apple) {
	closed2 := false
	for v := range in1 {
		out <- v
		v, ok := <-in2
		if ok {
			out <- v
		} else {
			closed2 = true
		}
	}
	if !closed2 {
		for _ = range in2 {
		}
	}
	close(out)
}
func AppleZip2 ( in1 , in2 <- chan Apple , out chan <- Apple ) { closed2 := false for v := range in1 { out <- v v , ok := <- in2 if ok { out <- v } else { closed2 = true } } if ! closed2 { for _ = range in2 { } } close ( out ) }
AppleZip2 interleaves two streams of Apple.
AppleZip2 interleaves two streams of Apple .
// need to drain in2 as well?