Created
June 26, 2012 20:10
-
-
Save dgrijalva/2998583 to your computer and use it in GitHub Desktop.
Echo shell. To test edsrzf/fineline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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