diff options
| author | jet2tlf <jet2tlf@gmail.com> | 2024-05-30 02:23:17 +0000 |
|---|---|---|
| committer | jet2tlf <jet2tlf@gmail.com> | 2024-05-30 02:23:17 +0000 |
| commit | 922895b424bfd679aceda1ce9bf141aef1b64206 (patch) | |
| tree | a8b1e15e86a70d6e478891d898a31a88e73af39f /cmd | |
| parent | d2e1a51ddb38942a5e24829a672712388bd8b8c1 (diff) | |
| download | shell-go-922895b424bfd679aceda1ce9bf141aef1b64206.tar.gz shell-go-922895b424bfd679aceda1ce9bf141aef1b64206.zip | |
pass 4st stage
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/myshell/main.go | 3 |
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")) |