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).
Synchronization with channels
The two channels problem
Report a typo
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)
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.