From 922895b424bfd679aceda1ce9bf141aef1b64206 Mon Sep 17 00:00:00 2001 From: jet2tlf Date: Wed, 29 May 2024 23:23:17 -0300 Subject: pass 4st stage --- cmd/myshell/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmd/myshell') diff --git a/cmd/myshell/main.go b/cmd/myshell/main.go index 6d591ab..5626017 100644 --- a/cmd/myshell/main.go +++ b/cmd/myshell/main.go @@ -22,7 +22,8 @@ func main() { switch in { case commands[0] == "exit": - os.Exit(strconv.Atoi(commands[1])) + n, err := strconv.Atoi(commands[1]) + os.Exit(n) } fmt.Printf("%s: command not found\n", strings.TrimRight(in, "\n")) -- cgit v1.2.3