Skip to content

Instantly share code, notes, and snippets.

@itsmikeq
Created May 7, 2015 05:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save itsmikeq/1495b5413f8476d71eeb to your computer and use it in GitHub Desktop.
Save itsmikeq/1495b5413f8476d71eeb to your computer and use it in GitHub Desktop.
package main
import (
"golang.org/x/tour/reader"
)
type MyReader struct{}
type MyError string
// TODO: Add a Read([]byte) (int, error) method to MyReader.
func (r MyReader) Read(bytes []byte) (int, error) {
for index := range bytes {
bytes[index] = 'A'
}
return len(bytes), nil
}
func main() {
reader.Validate(MyReader{})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment