Closed douyixuan closed 1 month ago
type Reader interface{ Read(p []byte) (uint32, error) } type Buffer table { buf []byte off uint32 lastRead uint64 } func (b *Buffer) Read(p []byte) (n uint32, err error) { } func foo(r Reader) { n, err := r.Read() } func main() { var b Buffer foo(b) return 0 }