func main() { rand.Seed(time.Now().UnixNano()) fmt.Printf("%v - TestErrors running ...\n\n", time.Now()) ErrorHelper.PublicErrorHelper() Core.CoreTest() }
func PublicErrorHelper() { // kann ich einen panic in CoreTest() auch heir abfangen (eine Ebene höher)? // yesssss ... defer func() { err := recover() if err != nil { fmt.Printf("recovered from: %v ...\n", err) } }() fmt.Printf("PublicErrorHelper - executing, after:%v ...\n", time.Since(tsStart)) Core.CoreTest() fmt.Printf("PublicErrorHelper - ... done.\n") }