Skip to content

Instantly share code, notes, and snippets.

@Shinpeim
Created May 1, 2015 16:00
Show Gist options
  • Save Shinpeim/a3fe192c7ed6d2a5c900 to your computer and use it in GitHub Desktop.
Save Shinpeim/a3fe192c7ed6d2a5c900 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
)
type TailByteReader struct {
}
func (r *TailByteReader) ReadByte() (c byte, e error) {
return 'a', nil
}
func newTailByteReader() *TailByteReader {
return &TailByteReader{}
}
func main() {
r := newTailByteReader()
for {
b, _ := r.ReadByte()
fmt.Printf("%c", b)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment