Created
December 9, 2011 05:08
-
-
Save jordanorelli/1450272 to your computer and use it in GitHub Desktop.
make Go puke
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
"runtime" | |
) | |
func tick() { | |
for { | |
fmt.Println("tick.", runtime.Goroutines()) | |
time.Sleep(1e9) | |
go tick() | |
} | |
} | |
func main() { | |
c := make(chan bool) | |
go tick() | |
<-c | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment