Created
November 30, 2020 01:01
-
-
Save minhphong306/da93c5174943a6f03ac8f335bceaea7d to your computer and use it in GitHub Desktop.
write_rap_song_main_func.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 main() { | |
rappers := []string{"Dế Choắt", "GDucky", "MCK", "TLinh", "Rtee"} | |
numBeat := 100 | |
wg := &sync.WaitGroup{} | |
beatChannel := make(chan string, 10) | |
// produceBeat | |
go produceBeat(numBeat, beatChannel) | |
// Write rap song | |
for _, rapper := range rappers { | |
wg.Add(1) | |
go writeSong(wg, rapper, beatChannel) | |
} | |
wg.Wait() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment