see below code
go MinuteForFirstRun()//sync
app.Run(iris.Addr(":"+appport), iris.WithCharset("UTF-8"))
but when error occure in MinuteForFirstRun() ,app exit.
what do I do ?
you should recover panics from the goroutine
put this in the first line of MinuteForFirstRun() function: defer func() { if r := recover(); r != nil { fmt.Println("Recovered in f", r) } }()
Обсуждают сегодня