Using return instead of os.Exit
This commit is contained in:
parent
03694f398a
commit
fecab5ee2c
2 changed files with 2 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue