In final i loop, G2 oddCh had write,but no read chan.(G1 already end) If you updated to
if i == 10 { close(oddCh) break } else { oddCh <- struct{}{} }
will no deadlock.