in a normal flow I don't need to wait for it to finish, however, in a test I'd like to wait. What would be a sensible way to go about this? Pass and return a channel?
You can use environment variables
Use waitgroups
Something like this? if inTestMode { myFunc() } else { go myFunc() }
Обсуждают сегодня