The two channels problem

Report a typo

You have defined two channels. Organize the program in such a way that it reads data from both channels. The program should proceed only after it recieves data from both channels. Print the received data separated by space on a single line (the chan1 data first).

Write a program in Go
package main

import (
"fmt"
"time"
)

func main() {
// Do not modify the lines below, they are used in the code
var chan1 = make(chan string)
var chan2 = make(chan string)
generator(chan1, chan2)

// provide your solution here

fmt.Println(?, ?)
// DO NOT delete or modify the lines below, they are used for checking the answer
time.Sleep(time.Second)
check(chan1, chan2)
}
___

Create a free account to access the full topic