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
|
index int
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewWriter(dst []byte) Writer {
|
func NewWriter(dst []byte) *Writer {
|
||||||
return Writer{
|
return &Writer{
|
||||||
dst:dst,
|
dst:dst,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -292,7 +292,7 @@ func TestWriterSingleWrite(t *testing.T) {
|
||||||
|
|
||||||
var buffer []byte = make([]byte, test.BufferLength)
|
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)
|
n, err := dst.Write(test.Src)
|
||||||
if _, casted := err.(buffers.TooShort); !casted {
|
if _, casted := err.(buffers.TooShort); !casted {
|
||||||
|
@ -857,7 +857,7 @@ func TestWriterMultipleWrites(t *testing.T) {
|
||||||
|
|
||||||
var buffer []byte = make([]byte, test.BufferLength)
|
var buffer []byte = make([]byte, test.BufferLength)
|
||||||
|
|
||||||
var dst buffers.Writer = buffers.NewWriter(buffer)
|
var dst *buffers.Writer = buffers.NewWriter(buffer)
|
||||||
|
|
||||||
var sum int
|
var sum int
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue