Skip to content

Instantly share code, notes, and snippets.

@Israel-Miles
Created September 27, 2021 15:44
Show Gist options
  • Save Israel-Miles/7f7fe32cd57f727f9304d3df6ddd3ac7 to your computer and use it in GitHub Desktop.
Save Israel-Miles/7f7fe32cd57f727f9304d3df6ddd3ac7 to your computer and use it in GitHub Desktop.
func receiveFromChannel(ch <-chan string, wg *sync.WaitGroup) {
defer wg.Done()
if msg, ok := <-ch; ok {
fmt.Println("Channel status:", ok)
fmt.Println(msg)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment