Create a gist now

Instantly share code, notes, and snippets.

A Tour of Go: Exercise: Readers,
package main
import ""
type MyReader struct{}
// Add a Read([]byte) (int, error) method to MyReader.
func (r MyReader) Read(b []byte) (int, error) {
b[0] = 'A'
return 1, nil
func main() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment