Skip to content

Commit 25ab56b

Browse files
author
David Garaña
committed
Fix http-prompt example (no exit)
Implement the exit function on the http-prompt example.
1 parent 723478a commit 25ab56b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

_example/http-prompt/main.go

+3
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ func executor(in string) {
105105
var method, body string
106106
blocks := strings.Split(in, " ")
107107
switch blocks[0] {
108+
case "exit":
109+
fmt.Println("Bye!")
110+
os.Exit(0)
108111
case "cd":
109112
if len(blocks) < 2 {
110113
ctx.url.Path = "/"

0 commit comments

Comments
 (0)