Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4. "fmt"
  5. "time"
  6. )
  7.  
  8. func main() {
  9. go middleFunc(8)
  10. // Don't care too much about this, I'm still looking at options to replace select {}
  11. select {}
  12. }
  13.  
  14. // This exists because I might wanna call doStuff on other places, without being in a timer
  15. func middleFunc(a int){
  16. doStuff(a)
  17. time.Sleep(time.Second * 10)
  18. middleFunc(a)
  19.  
  20. }
  21.  
  22. func doStuff(a int){
  23. fmt.Println(a)
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement