as title said, is there a way to create a new gomock controller without NewController? the comment in the package said
// NewController returns a new Controller. It is the preferred way to create a
// Controller.
I'm wondering if there is a way for creating it without the constructor?
I tried many ways, like creating it using new()
and assigning the variables directly but the controller won't work
Type
Controller
has a private fieldexpectedCalls
which cannot be set outside the constructor. You need to useNewController
orWithContext
functions.