From fecab5ee2cc6feaaa88e8fa37bb7fd59ed0289c4 Mon Sep 17 00:00:00 2001 From: Mihalis Tsoukalos Date: Thu, 11 Apr 2019 12:15:31 +0300 Subject: [PATCH] Using return instead of os.Exit --- ch10/noRaceC.go | 2 +- ch10/raceC.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ch10/noRaceC.go b/ch10/noRaceC.go index 1371b38..c27ba37 100644 --- a/ch10/noRaceC.go +++ b/ch10/noRaceC.go @@ -13,7 +13,7 @@ func main() { arguments := os.Args if len(arguments) != 2 { fmt.Println("Give me a natural number!") - os.Exit(1) + return } numGR, err := strconv.Atoi(os.Args[1]) if err != nil { diff --git a/ch10/raceC.go b/ch10/raceC.go index 1f5d236..61f5595 100644 --- a/ch10/raceC.go +++ b/ch10/raceC.go @@ -11,7 +11,7 @@ func main() { arguments := os.Args if len(arguments) != 2 { fmt.Println("Give me a natural number!") - os.Exit(1) + return } numGR, err := strconv.Atoi(os.Args[1]) if err != nil {