3 ms·
Using a waitgroup will fix your problem in your example.
by mykowebhn 6y ago
Using a waitgroup will fix your problem in your example.
- cratermoon 6y agoGo convention would be to pass a 'done' channel to myFunc and only close the db on receipt of a message on the channel.