Skip to content

Instantly share code, notes, and snippets.

@ta1kt0me
Created January 22, 2017 08:03
Show Gist options
  • Select an option

  • Save ta1kt0me/eb92c585242fbba16a4cd435632de638 to your computer and use it in GitHub Desktop.

Select an option

Save ta1kt0me/eb92c585242fbba16a4cd435632de638 to your computer and use it in GitHub Desktop.
Exercise: Readers
package main
import (
"golang.org/x/tour/reader"
)
type MyReader struct{}
func (t MyReader) Read(b []byte) (int, error) {
b[0] = 'A'
return 1, nil
}
func main() {
reader.Validate(MyReader{})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment