The goroutine started after receiving an inv also spawns its own goroutines and increments the waitgroup counter. This is invalid waitgroup usage as it could occur concurrently with or after the call to Wait(). Removing the superfluous outer goroutine fixes this issue.
The goroutine started after receiving an inv also spawns its own goroutines and increments the waitgroup counter. This is invalid waitgroup usage as it could occur concurrently with or after the call to Wait(). Removing the superfluous outer goroutine fixes this issue.