Skip to content

Instantly share code, notes, and snippets.

@minhphong306
Created November 30, 2020 01:07
Show Gist options
  • Save minhphong306/22dff34ff6d8822641846a1549d16414 to your computer and use it in GitHub Desktop.
Save minhphong306/22dff34ff6d8822641846a1549d16414 to your computer and use it in GitHub Desktop.
write_rap_song_write_song.go
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