In errgroup, the step to increment the WaitGroup counter (wg.Add) is 
written after acquiring a token from the semaphore (sem). Is it possible 
that if all goroutines finish execution and call wg.Done at nearly the same 
time, the currently blocked goroutines do not immediately call wg.Add due 
to scheduling issues, resulting in the WaitGroup counter dropping to zero 
and causing wg.Wait() to return prematurely, leading to errors in the 
program?  


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/22ceece2-843c-47d6-ab5b-b5ddc5e51176n%40googlegroups.com.

Reply via email to