made buffers.NewWriter() return a *buffers.Writer, rather than a buffers.Writer
parent
a0e5c6762a
commit
068d259699
|
@ -8,8 +8,8 @@ type Writer struct {
|
|||
index int
|
||||
}
|
||||
|
||||
func NewWriter(dst []byte) Writer {
|
||||
return Writer{
|
||||
func NewWriter(dst []byte) *Writer {
|
||||
return &Writer{
|
||||
dst:dst,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -292,7 +292,7 @@ func TestWriterSingleWrite(t *testing.T) {
|
|||
|
||||
var buffer []byte = make([]byte, test.BufferLength)
|
||||
|
||||
var dst buffers.Writer = buffers.NewWriter(buffer)
|
||||
var dst *buffers.Writer = buffers.NewWriter(buffer)
|
||||
|
||||
n, err := dst.Write(test.Src)
|
||||
if _, casted := err.(buffers.TooShort); !casted {
|
||||
|
@ -857,7 +857,7 @@ func TestWriterMultipleWrites(t *testing.T) {
|
|||
|
||||
var buffer []byte = make([]byte, test.BufferLength)
|
||||
|
||||
var dst buffers.Writer = buffers.NewWriter(buffer)
|
||||
var dst *buffers.Writer = buffers.NewWriter(buffer)
|
||||
|
||||
var sum int
|
||||
|
||||
|
|
Loading…
Reference in New Issue