Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. ...
  2. result := []int{}
  3. wg sync.WaitGroup
  4.  
  5. exampleInsert := []int{1,2,3,4,5,6,7,8,9,10}
  6.  
  7. for i:=0; i < 100; i ++ {
  8. wg.add(1)
  9. go func() {
  10. defer wg.Done()
  11. result = append(result, exampleInsert ...)
  12. }
  13. }()
  14. }
  15. wg.Wait()
  16. fmt.Println("size is not 1000! its %d", len(result))
  17. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement