rollback: NewMockWriter return MockWriter -> *MockWriter

pull/2/head
q191201771 5 years ago
parent b2ab992bb2
commit 754f9e8c3e

@ -26,8 +26,8 @@ type MockWriter struct {
b bytes.Buffer b bytes.Buffer
} }
func NewMockWriter(t WriterType) MockWriter { func NewMockWriter(t WriterType) *MockWriter {
return MockWriter{ return &MockWriter{
t: t, t: t,
} }
} }

@ -11,7 +11,7 @@ func TestNewMockWriter(t *testing.T) {
func TestMockWriter_Write(t *testing.T) { func TestMockWriter_Write(t *testing.T) {
var ( var (
w MockWriter w *MockWriter
n int n int
err error err error
b = []byte("hello") b = []byte("hello")
@ -35,7 +35,7 @@ func TestMockWriter_Write(t *testing.T) {
func TestMockWriter_SetSpecificType(t *testing.T) { func TestMockWriter_SetSpecificType(t *testing.T) {
var ( var (
w MockWriter w *MockWriter
n int n int
err error err error
b = []byte("hello") b = []byte("hello")
@ -80,8 +80,8 @@ func BenchmarkNewMockWriter(b *testing.B) {
} }
} }
func newMockWriter2(t WriterType) *MockWriter { func newMockWriter2(t WriterType) MockWriter {
return &MockWriter{ return MockWriter{
t: t, t: t,
} }
} }

Loading…
Cancel
Save