Skip to content

Instantly share code, notes, and snippets.

@martincartledge
Created August 5, 2020 11:31
package main
import (
"fmt"
)
func main() {
chat := make(chan string, 5)
chat <- "Hey!"
chat <- "How's it going?"
chat <- "Doing well"
chat <- "I started watching Dark"
chat <- "It's so good"
// added message
chat <- "No spoilers please!"
fmt.Println(<- chat)
fmt.Println(<- chat)
fmt.Println(<- chat)
fmt.Println(<- chat)
fmt.Println(<- chat)
// added log
fmt.Println(<- chat)
// Hey!
// How's it going?
// Doing well
// I started watching Dark
// It's so good
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment