mock
mock copied to clipboard
Unable to SetArg with chan
type IMQ interface {
Publish(channel string, message interface{}) error
Subscribe(channel string, message chan<- string)
}
// Test
mockMQ := mq.NewMockIMQ(ctrl)
message := make(chan string)
mockMQ.EXPECT().Subscribe(
gomock.Eq("channel"),
gomock.Any(),
).SetArg(1, message)
// error -> SetArg(1, ...) referring to argument of non-pointer non-interface non-slice type chan<- string