exercise1: reader
This commit is contained in:
parent
728c487b76
commit
a3edafb756
1 changed files with 13 additions and 0 deletions
13
exercises/readers.go
Normal file
13
exercises/readers.go
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
//import "golang.org/x/tour/reader"
|
||||||
|
|
||||||
|
type MyReader struct{}
|
||||||
|
|
||||||
|
func (ret MyReader) Read(b []byte) (int, error) {
|
||||||
|
copy(b, "A")
|
||||||
|
return 1, nil
|
||||||
|
}
|
||||||
|
func main() {
|
||||||
|
//reader.Validate(MyReader{})
|
||||||
|
}
|
Loading…
Reference in a new issue