https://github.com/golang/go/blob/c0a0ba254c48fc855f9501b0bd3b78e6847ca923/src/io/io_test.go#L167

I was walking through this code, and it didn't seem to hit [WriteTo] 
(https://github.com/golang/go/blob/c0a0ba254c48fc855f9501b0bd3b78e6847ca923/src/io/io.go#L410-L412)
 
because of LimitReader

Is this intended behavior?  

1. TestCopyNWriteTo does not assert if `WriteTo` is called.  It should 
either add this or test should be renamed.
2. WriteTo not called using CopyN,
 
```
func TestCopyNWriteTo(t *testing.T) {
rb := new(writeToChecker) // implements WriteTo.
wb := new(Buffer)
rb.WriteString("hello, world.")
CopyN(wb, rb, 5)
if wb.String() != "hello" {
t.Errorf("CopyN did not work properly")
} else if !rb.writeToCalled {
t.Errorf("CopyN does not use writeTo")
}
}
```

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/a79a8234-2223-44cd-81f4-d93ee3e45516n%40googlegroups.com.

Reply via email to