mock icon indicating copy to clipboard operation
mock copied to clipboard

Unable to SetArg with chan

Open ahl5esoft opened this issue 4 years ago • 0 comments

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

ahl5esoft avatar Jan 18 '21 09:01 ahl5esoft