Skip to content

Instantly share code, notes, and snippets.

@dgrijalva
Created June 26, 2012 20:10
Show Gist options
  • Save dgrijalva/2998583 to your computer and use it in GitHub Desktop.
Save dgrijalva/2998583 to your computer and use it in GitHub Desktop.
Echo shell. To test edsrzf/fineline
package main
import (
"fmt"
"github.com/edsrzf/fineline"
)
func main(){
lr := fineline.NewLineReader(nil)
for {
if line, err := lr.Read(); err == nil {
fmt.Print(line)
if len(line) >= 3 && line[0:3] == "bye" {
break
}
} else {
fmt.Println("Err returned:", err)
}
}
fmt.Println("Bye!")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment