Advertisement
Guest User

Untitled

a guest
May 24th, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6. // launch goroutine in background
  7. go func() {
  8. fmt.Println("Hello, playground")
  9. }()
  10. //
  11. // Does not print anything
  12. //
  13. // when main returns
  14. // the program exits
  15. // and the goroutine will not be run
  16. // and gets garbage-collected
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement