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