Documentation
¶
Overview ¶
Package io is Evie's console package: print, println, prompt and readln.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LineReader ¶
type LineReader struct {
// contains filtered or unexported fields
}
LineReader reads lines from one source for everyone who reads from it: the io package of any number of engines, and the host itself, such as a REPL reading its own input between scripts. Give it to an engine as evie.Options.Stdin and the io package reads through it rather than through a buffer of its own, so no reader takes lines meant for another.
A read that is cancelled leaves its line pending, and the next read gets it, so no line is lost. A Read of the source itself cannot be cancelled: one that never returns keeps its goroutine until the source is closed.
func NewLineReader ¶
func NewLineReader(src goio.Reader) *LineReader
NewLineReader makes a line reader for src