Skip to content

Instantly share code, notes, and snippets.

@zainfathoni
Created April 11, 2017 02:29
Show Gist options
  • Save zainfathoni/ce9864de3f2cf90c30eb3a8480a4ffea to your computer and use it in GitHub Desktop.
Save zainfathoni/ce9864de3f2cf90c30eb3a8480a4ffea to your computer and use it in GitHub Desktop.
package main
import "golang.org/x/tour/reader"
type MyReader struct{}
func (r MyReader) Read(b []byte) (n int, err error) {
b[0] = 'A'
return 1, nil
}
// TODO: Add a Read([]byte) (int, error) method to MyReader.
func main() {
reader.Validate(MyReader{})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment