Skip to content

Instantly share code, notes, and snippets.

@kidinamoto01
Created December 18, 2017 09:04
Show Gist options
  • Save kidinamoto01/716840fb3a18870f23306a3bfa807f4d to your computer and use it in GitHub Desktop.
Save kidinamoto01/716840fb3a18870f23306a3bfa807f4d to your computer and use it in GitHub Desktop.
package main
import "code.google.com/p/go-tour/reader"
type MyReader struct{}
func (r MyReader) Read(bytes []byte) (int, error) {
for i := range bytes {
bytes[i] = 65
}
return len(bytes), 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