Created
November 30, 2020 01:07
-
-
Save minhphong306/22dff34ff6d8822641846a1549d16414 to your computer and use it in GitHub Desktop.
write_rap_song_write_song.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func writeSong(wg *sync.WaitGroup, rapper string, beatChannel chan string) { | |
defer wg.Done() | |
for { | |
beat, ok := <-beatChannel | |
if !ok { | |
fmt.Printf("Hết beat. %s ra khỏi phòng thu\n", rapper) | |
return | |
} | |
fmt.Printf("Rapper %s sử dụng beat %s\n", rapper, beat) | |
wait() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment