aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjet2tlf <jet2tlf@gmail.com>2024-05-30 02:21:58 +0000
committerjet2tlf <jet2tlf@gmail.com>2024-05-30 02:21:58 +0000
commitd2e1a51ddb38942a5e24829a672712388bd8b8c1 (patch)
tree261ab1d212b411a08add1051f17228db20d857b0
parent4a9731f352df928fba1e0701397259002f0caf43 (diff)
downloadshell-go-d2e1a51ddb38942a5e24829a672712388bd8b8c1.tar.gz
shell-go-d2e1a51ddb38942a5e24829a672712388bd8b8c1.zip
pass 4st stage
-rw-r--r--cmd/myshell/main.go5
1 files changed, 3 insertions, 2 deletions
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"))