Using return instead of os.Exit

This commit is contained in:
Mihalis Tsoukalos 2019-04-11 12:15:31 +03:00
commit fecab5ee2c
2 changed files with 2 additions and 2 deletions

View file

@ -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 {

View file

@ -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 {