Skip to content

Instantly share code, notes, and snippets.

@xlqstar
Created August 30, 2013 17:07
Show Gist options
  • Save xlqstar/6392088 to your computer and use it in GitHub Desktop.
Save xlqstar/6392088 to your computer and use it in GitHub Desktop.
package main
import (
"bufio"
"log"
"os"
)
func main() {
running := true
reader := bufio.NewReader(os.Stdin)
for running {
data, _, _ := reader.ReadLine()
command := string(data)
if command == "stop" {
running = false
}
log.Println("command", command)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment