Skip to content

Instantly share code, notes, and snippets.

@ddadlani
Created July 4, 2019 19:02
Show Gist options
  • Save ddadlani/247b0dcea60e835d937a10ce0aa786f7 to your computer and use it in GitHub Desktop.
Save ddadlani/247b0dcea60e835d937a10ce0aa786f7 to your computer and use it in GitHub Desktop.
Channel testing example
func CallerMethod() {
events := make(chan string)
go func() {
Callee(events)
}()
select {
case msg := <-events:
fmt.Println(msg)
}
}
func Callee(events chan string) {
events <- "hello"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment