diff options
Diffstat (limited to 'pkg/tcpip/buffer/view.go')
-rw-r--r-- | pkg/tcpip/buffer/view.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/tcpip/buffer/view.go b/pkg/tcpip/buffer/view.go index 5dd1b1b6b..09d3dac66 100644 --- a/pkg/tcpip/buffer/view.go +++ b/pkg/tcpip/buffer/view.go @@ -17,6 +17,7 @@ package buffer import ( "bytes" + "fmt" "io" ) @@ -167,6 +168,9 @@ func (vv *VectorisedView) ReadTo(dst io.Writer, count int, peek bool) (int, erro if err != nil { break } + if n != len(v) { + panic(fmt.Sprintf("io.Writer.Write succeeded with incomplete write: %d != %d", n, len(v))) + } } if !peek { vv.TrimFront(done) |