func repl()

in whisk/start.go [33:48]


func repl(fn ActionFunction, in io.Reader, out io.Writer) {
	// read loop
	reader := bufio.NewReader(in)
	for {
		event, err := reader.ReadBytes('\n')
		if err != nil {
			break
		}
		result, err := fn(event)
		if err != nil {
			fmt.Fprintf(out, "{ error: %q}\n", err.Error())
			continue
		}
		fmt.Fprintln(out, string(result))
	}
}