aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/myshell/main.go3
1 files changed, 2 insertions, 1 deletions
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"))