github.com/HaHadaxigua/yaegi@v1.0.1/_test/issue-1136.go (about) 1 package main 2 3 import ( 4 "fmt" 5 "io" 6 ) 7 8 type T struct { 9 r io.Reader 10 } 11 12 func (t *T) Read(p []byte) (n int, err error) { n, err = t.r.Read(p); return } 13 14 func main() { 15 x := io.LimitedReader{} 16 y := io.Reader(&x) 17 y = &T{y} 18 fmt.Println(y.Read([]byte(""))) 19 } 20 21 // Output: 22 // 0 EOF