Exercise: Readers
Implement a Reader type that produces an infinite stream of the ASCII character 'A'.
Add a Read([]byte) (int, error) method to MyReader. Fill every byte in the slice with 'A' and return the length — never return io.EOF.
Implement a Reader type that produces an infinite stream of the ASCII character 'A'.
Add a Read([]byte) (int, error) method to MyReader. Fill every byte in the slice with 'A' and return the length — never return io.EOF.
package main
import "golang.org/x/tour/reader"
type MyReader struct{}
// TODO: Add a Read([]byte) (int, error) method to MyReader.
func main() {
reader.Validate(MyReader{})
} ← → Use arrow keys to navigate