From 6e17df80aba16a5750f49854d216511979066695 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Wed, 7 Nov 2012 00:16:13 -0500 Subject: [PATCH] The buffered channel example... --- .../gotour-artifacts/buffered-channels/main.go | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 gotime/src/meatballhat.com/gotour-artifacts/buffered-channels/main.go diff --git a/gotime/src/meatballhat.com/gotour-artifacts/buffered-channels/main.go b/gotime/src/meatballhat.com/gotour-artifacts/buffered-channels/main.go new file mode 100644 index 0000000..c47b4ae --- /dev/null +++ b/gotime/src/meatballhat.com/gotour-artifacts/buffered-channels/main.go @@ -0,0 +1,11 @@ +package main + +import "fmt" + +func main() { + c := make(chan int, 2) + c <- 1 + c <- 2 + fmt.Println(<-c) + fmt.Println(<-c) +}