Skip to content

Instantly share code, notes, and snippets.

View alexchowle's full-sized avatar

Alex Howle alexchowle

View GitHub Profile
@alexchowle
alexchowle / awaitfirst.go
Created February 7, 2016 20:58
Golang concurrency - await first returned
package main
import (
"fmt"
"math/rand"
"time"
)
func main() {
ch := make(chan struct{})
@alexchowle
alexchowle / awaitall.go
Last active February 7, 2016 20:59
Golang concurrency - waiting for all to return
package main
import (
"fmt"
"math/rand"
"time"
)
func main() {
ch := make(chan struct{})
@alexchowle
alexchowle / pingpong.go
Created February 7, 2016 16:57
Simple golang pingpong
package main
import (
"fmt"
)
func main() {
pingChan := make(chan string)
pongChan := make(chan string)