daily pastebin goal
36%
SHARE
TWEET

Untitled

a guest Jun 22nd, 2018 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. concurrency := 15
  2. sem := make(chan bool, concurrency)
  3.  
  4. for _, username := range users {
  5.     sem <- true
  6.     go func(user string) {
  7.         doStuffToUser()
  8.     }(user)
  9. }
  10.  
  11. for i := 0; i < cap(sem); i++ {
  12.     sem <- true
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top