Skip to content

Instantly share code, notes, and snippets.

@nilsmagnus
Last active August 29, 2015 14:14
Show Gist options
  • Save nilsmagnus/3be35eaea77db4f285b5 to your computer and use it in GitHub Desktop.
Save nilsmagnus/3be35eaea77db4f285b5 to your computer and use it in GitHub Desktop.
package main
import "code.google.com/p/go-tour/reader"
type MyReader struct{}
func (reader *MyReader) Read(b []byte )(n int, e error) {
for i:=0; i< len(b); i++ {
b[i] = 'A'
}
return int(len(b)), nil
}
func main() {
reader.Validate(&MyReader{})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment