@@ -40,7 +40,7 @@ func TestCreator_One(t *testing.T) {
4040 name string
4141 mock func (ctx context.Context , ctl * gomock.Controller ) iCreator [types.TestUser ]
4242 ctx context.Context
43- doc types.TestUser
43+ doc * types.TestUser
4444
4545 wantId string
4646 wantErr error
@@ -49,31 +49,31 @@ func TestCreator_One(t *testing.T) {
4949 name : "duplicate" ,
5050 mock : func (ctx context.Context , ctl * gomock.Controller ) iCreator [types.TestUser ] {
5151 mockCollection := mocks.NewMockiCreator [types.TestUser ](ctl )
52- mockCollection .EXPECT ().InsertOne (ctx , types.TestUser {
52+ mockCollection .EXPECT ().InsertOne (ctx , & types.TestUser {
5353 Id : "123" ,
5454 Name : "cmy" ,
5555 Age : 18 ,
5656 }).Return (nil , errors .New ("duplicate key" )).Times (1 )
5757 return mockCollection
5858 },
5959 ctx : context .Background (),
60- doc : types.TestUser {Id : "123" , Name : "cmy" , Age : 18 },
60+ doc : & types.TestUser {Id : "123" , Name : "cmy" , Age : 18 },
6161 wantId : "" ,
6262 wantErr : errors .New ("duplicate key" ),
6363 },
6464 {
6565 name : "success" ,
6666 mock : func (ctx context.Context , ctl * gomock.Controller ) iCreator [types.TestUser ] {
6767 mockCollection := mocks.NewMockiCreator [types.TestUser ](ctl )
68- mockCollection .EXPECT ().InsertOne (ctx , types.TestUser {
68+ mockCollection .EXPECT ().InsertOne (ctx , & types.TestUser {
6969 Id : "123" ,
7070 Name : "cmy" ,
7171 Age : 18 ,
7272 }).Return (& mongo.InsertOneResult {InsertedID : "123" }, nil ).Times (1 )
7373 return mockCollection
7474 },
7575 ctx : context .Background (),
76- doc : types.TestUser {
76+ doc : & types.TestUser {
7777 Id : "123" ,
7878 Name : "cmy" ,
7979 Age : 18 ,
@@ -101,7 +101,7 @@ func TestCreator_Many(t *testing.T) {
101101 name string
102102 mock func (ctx context.Context , ctl * gomock.Controller ) iCreator [types.TestUser ]
103103 ctx context.Context
104- doc []types.TestUser
104+ doc []* types.TestUser
105105
106106 wantIds []string
107107 wantErr error
@@ -110,7 +110,7 @@ func TestCreator_Many(t *testing.T) {
110110 name : "duplicate" ,
111111 mock : func (ctx context.Context , ctl * gomock.Controller ) iCreator [types.TestUser ] {
112112 mockCollection := mocks.NewMockiCreator [types.TestUser ](ctl )
113- mockCollection .EXPECT ().InsertMany (ctx , []types.TestUser {
113+ mockCollection .EXPECT ().InsertMany (ctx , []* types.TestUser {
114114 {
115115 Id : "123" ,
116116 Name : "cmy" ,
@@ -124,7 +124,7 @@ func TestCreator_Many(t *testing.T) {
124124 return mockCollection
125125 },
126126 ctx : context .Background (),
127- doc : []types.TestUser {
127+ doc : []* types.TestUser {
128128 {Id : "123" , Name : "cmy" , Age : 18 },
129129 {Id : "123" , Name : "cmy" , Age : 18 },
130130 },
@@ -135,7 +135,7 @@ func TestCreator_Many(t *testing.T) {
135135 name : "success" ,
136136 mock : func (ctx context.Context , ctl * gomock.Controller ) iCreator [types.TestUser ] {
137137 mockCollection := mocks.NewMockiCreator [types.TestUser ](ctl )
138- mockCollection .EXPECT ().InsertMany (ctx , []types.TestUser {
138+ mockCollection .EXPECT ().InsertMany (ctx , []* types.TestUser {
139139 {
140140 Id : "123" ,
141141 Name : "cmy" ,
@@ -149,7 +149,7 @@ func TestCreator_Many(t *testing.T) {
149149 return mockCollection
150150 },
151151 ctx : context .Background (),
152- doc : []types.TestUser {
152+ doc : []* types.TestUser {
153153 {Id : "123" , Name : "cmy" , Age : 18 },
154154 {Id : "456" , Name : "cmy" , Age : 18 },
155155 },
0 commit comments