Conversation
|
Thanks, this is already helpful. Prior to this there were a number of places where the channel was just defined as struct{}. Now it's obvious that responsMsg is the type that should be on the channel, and that is key to understanding this example. |
|
In retrospect, since responseMsg was already defined then just substituting |
mdepot
left a comment
There was a problem hiding this comment.
It looks like this would still work ok if ChatMessage was private (lower case). If not, please help me understand why it might be good to leave it exported.
Also, printing Last Message could use a leading space for alignment.
|
@meowgorithm or @aymanbagabas would either of you mind reviewing this? |
|
Hey @FFCoder. Apologies for the delay on this one: we've been very backlogged. This is a helpful PR and wed be happy to merge it with some changes (notably, I'd use the If you're willing to reopen it we'd be happy to make those changes and merge it. |
Per Issue #1242 updated the real time example to grab some random chat messages and send it down the channel. This will be used to demonstrate how a production application could send messages over a channel.
Largely, I tried to limit changes as much as possible other than what is needed. I'm still new-ish to Golang so I welcome criticism or if we want to go another way with this I'm happy to change!