From a97fa3f1ac8f079a6ad64e4eb1b15ea6f633075a Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 8 Jul 2020 22:30:13 +0200 Subject: [PATCH] example: don't os.Exit unconditionally, hiding panics Signed-off-by: Elias Naur --- example/gophers/main.go | 2 +- example/hello/hello.go | 2 +- example/kitchen/kitchen.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/gophers/main.go b/example/gophers/main.go index dc233279..8cd3c9f0 100644 --- a/example/gophers/main.go +++ b/example/gophers/main.go @@ -60,10 +60,10 @@ func main() { app.Size(unit.Dp(400), unit.Dp(800)), app.Title("Gophers"), ) - defer os.Exit(0) if err := newApp(w).run(); err != nil { log.Fatal(err) } + os.Exit(0) }() app.Main() } diff --git a/example/hello/hello.go b/example/hello/hello.go index 82f403d9..ec8dfe00 100644 --- a/example/hello/hello.go +++ b/example/hello/hello.go @@ -21,11 +21,11 @@ import ( func main() { go func() { - defer os.Exit(0) w := app.NewWindow() if err := loop(w); err != nil { log.Fatal(err) } + os.Exit(0) }() app.Main() } diff --git a/example/kitchen/kitchen.go b/example/kitchen/kitchen.go index 293888a9..af0b4973 100644 --- a/example/kitchen/kitchen.go +++ b/example/kitchen/kitchen.go @@ -68,11 +68,11 @@ func main() { }() go func() { - defer os.Exit(0) w := app.NewWindow(app.Size(unit.Dp(800), unit.Dp(700))) if err := loop(w); err != nil { log.Fatal(err) } + os.Exit(0) }() app.Main() }