윤준석

ADD: implements exit function

Showing 1 changed file with 9 additions and 0 deletions
...@@ -13,6 +13,15 @@ func main() { ...@@ -13,6 +13,15 @@ func main() {
13 fmt.Print("input: ") 13 fmt.Print("input: ")
14 sc.Scan() 14 sc.Scan()
15 input = sc.Text() 15 input = sc.Text()
16 +
17 + exit(input)
18 +
16 fmt.Printf("output: %s\n", input) 19 fmt.Printf("output: %s\n", input)
17 } 20 }
21 +}
22 +
23 +func exit(input string) {
24 + if input == "exit" {
25 + os.Exit(0)
26 + }
18 } 27 }
...\ No newline at end of file ...\ No newline at end of file
......