Created
April 11, 2017 02:29
-
-
Save zainfathoni/ce9864de3f2cf90c30eb3a8480a4ffea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "golang.org/x/tour/reader" | |
type MyReader struct{} | |
func (r MyReader) Read(b []byte) (n int, err error) { | |
b[0] = 'A' | |
return 1, 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