Skip to content

Instantly share code, notes, and snippets.

@hnsl
Created September 18, 2015 21:36
Show Gist options
  • Save hnsl/4030290c6b22c1723bc6 to your computer and use it in GitHub Desktop.
Save hnsl/4030290c6b22c1723bc6 to your computer and use it in GitHub Desktop.
test close
ch := make(chan interface{})
msg := "foo"
go func() {
x := <- ch
if _, ok := x.(string); ok {
jlib.JPrint("%s", x.(string))
}
close(ch)
}()
jlib.JPrint("%t", jlib.SendRemoteCmd(ch, msg))
jlib.JPrint("%t", jlib.SendRemoteCmd(ch, msg))
jlib.JPrint("%t", jlib.SendRemoteCmd(ch, msg))
jlib.JPrint("%t", jlib.SendRemoteCmd(ch, msg))
jlib.JPrint("%t", jlib.SendRemoteCmd(ch, msg))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment