Javascript CLI in Go using Otto
Today, I was playing with Otto and hacked together a small command-line-interface program in Go. package main import ( "bufio" "fmt" "os" "strings" "github.com/robertkrimen/otto" ) var Otto = otto.New() func main() { fmt.Println("otto\n") loop() } func dispatch(entry string) string { if len(entry) == 0 { return entry } value, err := Otto.Run(entry) if err != nil { return err.Error() } else { return fmt.Sprintf("%v", value) } } func loop() { for { fmt.