I'm using gomock
(source mode) and wish to mock a piece of code that looks something like:
type foo interface {
MethodA() int
}
type Boo interface {
MethodB(f foo) string
}
where the unexported foo
interface is used as an argument in MethodB()
. After using mockgen, the mocked MethodB()
looks like:
func (m &MockBoo) MethodB(f foo) string { ... }
which is erroneous because foo
is unexported and can't be accessed.
Was wondering if theres a way around it (eg. for foo
to be Mockfoo
instead as the argument)?
PS. I tried gomock reflect
mode as well but it had the same problem.