Exercise: Readers

Implement a Reader type that emits an infinite stream of the ASCII character 'A'.

exercise-reader.go

  1. package main
  2. import "golang.org/x/tour/reader"
  3. type MyReader struct{}
  4. // TODO: Add a Read([]byte) (int, error) method to MyReader.
  5. func main() {
  6. reader.Validate(MyReader{})
  7. }