Open alextoulps opened 1 year ago
You put it in a wrong place, you should ensure calling Wait only after Start is called without errors
You put it in a wrong place, you should ensure calling Wait only after Start is called without errors
Yeah was also debating if it should be right after the Start but since it is a defer
and the implementation of Wait will in worst case return an error that will be ignored, i wanted to follow the practice of ensuring defer call right after the initialisation of the resource that needs to ensure clean up of resources.
As there is a usage of
cmd.Start()
ensure that Wait() will be called to clean up resources. Currently in a running app that might poll for the status, this causes a leak.