Skip to content

Commit

Permalink
Wrap comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ash2k committed Oct 29, 2024
1 parent 98fad9a commit b46c562
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions mem/buffer_slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ func NewWriter(buffers *BufferSlice, pool BufferPool) io.Writer {
// A successful call returns err == nil, not err == EOF. Because ReadAll is
// defined to read from src until EOF, it does not treat an EOF from Read
// as an error to be reported.
// A failed call returns a non-nil error and could return partially read buffers.
// It is the responsibility of the caller to free this buffer.
// A failed call returns a non-nil error and could return partially read
// buffers. It is the responsibility of the caller to free this buffer.
func ReadAll(r io.Reader, pool BufferPool) (BufferSlice, error) {
var result BufferSlice
wt, ok := r.(io.WriterTo)
Expand Down
9 changes: 6 additions & 3 deletions mem/buffer_slice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ func (s) TestBufferSlice_Reader(t *testing.T) {
}
}

// TestBufferSlice_ReadAll_Reads exercises ReadAll by allowing it to read various combinations of data, empty data, EOF.
// TestBufferSlice_ReadAll_Reads exercises ReadAll by allowing it to read
// various combinations of data, empty data, EOF.
func (s) TestBufferSlice_ReadAll_Reads(t *testing.T) {
testcases := []struct {
name string
Expand Down Expand Up @@ -349,7 +350,8 @@ func (s) TestBufferSlice_ReadAll_Reads(t *testing.T) {
if len(data) != tc.wantBufs {
t.Fatalf("ReadAll() returned %d bufs, wanted %d bufs", len(data), tc.wantBufs)
}
for i := 0; i < len(data)-1; i++ { // all but last should be full buffers
// all but last should be full buffers
for i := 0; i < len(data)-1; i++ {
if data[i].Len() != readAllBufSize {
t.Fatalf("ReadAll() returned data length %d, wanted %d", data[i].Len(), readAllBufSize)
}
Expand Down Expand Up @@ -434,7 +436,8 @@ var (
_ mem.BufferPool = (*testPool)(nil)
)

// readStep describes what a single stepReader.Read should do - how much data to return and what error to return.
// readStep describes what a single stepReader.Read should do - how much data
// to return and what error to return.
type readStep struct {
n int
err error
Expand Down

0 comments on commit b46c562

Please sign in to comment.