Skip to content

Instantly share code, notes, and snippets.

@poppen
Last active June 15, 2016 07:11
Show Gist options
  • Save poppen/83fbe05bb52cc18230239d562f402c8d to your computer and use it in GitHub Desktop.
Save poppen/83fbe05bb52cc18230239d562f402c8d to your computer and use it in GitHub Desktop.
package main
import "golang.org/x/tour/reader"
type MyReader struct{}
// TODO: Add a Read([]byte) (int, error) method to MyReader.
func (r 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