Created
January 22, 2017 08:03
-
-
Save ta1kt0me/eb92c585242fbba16a4cd435632de638 to your computer and use it in GitHub Desktop.
Exercise: Readers
This file contains hidden or 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 ( | |
| "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