Skip to content

Instantly share code, notes, and snippets.

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