continue the execution of a function after handled panic

I’m trying to make a task scheduler that does tasks in the given interval and also can handle an occurring panic. My question is how can I continue executing the function after handling the panic. func scheduleTask(task func() error, interval time.Duration, timeout time.Duration) { //add waitgroup and mutex var wg sync.WaitGroup var mtx sync.Mutex var… Read More continue the execution of a function after handled panic

calling wait group done right after go routine starts?

https://go.dev/play/p/YVYRWSgcp4u I’m seeing this code in "Concurrency in Go Tools and Techniques for Developers", where it’s mentioned about the usage for broadcast, the context is to use broadcast to wake three goroutings. package main import ( "fmt" "sync" "time" ) func main() { type Button struct { Clicked *sync.Cond } button := Button{Clicked: sync.NewCond(&sync.Mutex{})} subscribe… Read More calling wait group done right after go routine starts?