aboutsummaryrefslogtreecommitdiff
path: root/cmd/myshell/main.go
diff options
context:
space:
mode:
authorjet2tlf <jet2tlf@gmail.com>2024-05-30 02:23:17 +0000
committerjet2tlf <jet2tlf@gmail.com>2024-05-30 02:23:17 +0000
commit922895b424bfd679aceda1ce9bf141aef1b64206 (patch)
treea8b1e15e86a70d6e478891d898a31a88e73af39f /cmd/myshell/main.go
parentd2e1a51ddb38942a5e24829a672712388bd8b8c1 (diff)
downloadshell-go-922895b424bfd679aceda1ce9bf141aef1b64206.tar.gz
shell-go-922895b424bfd679aceda1ce9bf141aef1b64206.zip
pass 4st stage
Diffstat (limited to 'cmd/myshell/main.go')
-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"))