Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
package main
import (
"fmt"
"strconv"
)
func whatever(c chan string, thr int) {
for i := 0; i < 100; i++ {
fmt.Printf("%d\n", i)
}
c <- "Thread " + strconv.Itoa(thr) + " done!"
}
func main() {
c := make(chan string)
for i := 0; i < 4; i++ {
go whatever(c, i)
}
for g := 0; g < 4; g++ {
fmt.Printf("%v\n", <-c)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.