File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -107,13 +107,16 @@ func (mq *MockQuery) unlock() {
107107//
108108// mock.On(r.Table("test")).Return(nil, errors.New("failed"))
109109//
110- // values of "chan interface{}" type will turn to delayed data that produce data
111- // when there is an element available on the channel. Values of "func()
112- // interface{}" type will produce data by calling the function. E.g.
110+ // values of `chan []interface{}` type will turn to delayed data that produce data
111+ // when there is an elements available on the channel. These elements are chunk of responses.
112+ // Values of `func() []interface{}` type will produce data by calling the function. E.g.
113+ // Closing channel or returning nil from func means end of data.
113114//
114- // f := func() interface{} { return 2 }
115- // ch := make(chan interface{})
116- // mock.On(r.Table("test")).Return([]interface{}{ch, f, 3})
115+ // f := func() []interface{} { return []interface{}{1, 2} }
116+ // mock.On(r.Table("test1")).Return(f)
117+ //
118+ // ch := make(chan []interface{})
119+ // mock.On(r.Table("test1")).Return(ch)
117120//
118121// Running the query above will block until a value is pushed onto ch.
119122func (mq * MockQuery ) Return (response interface {}, err error ) * MockQuery {
You can’t perform that action at this time.
0 commit comments