Creates Mocks for Unexported Types When Not In Same Package
nelsam opened this issue · comments
Samuel Nelson commented
Some of this may be easy, but I expect at least some parts to be difficult. Still, It's at least worth doing the easier stuff; and I'd like to do the more difficult stuff some day. Basically, when the mock is in a separate test package (which is the default), we should ignore any interface types that should not be implemented outside of the main package (i.e. are unexported, include unexported methods, or include unexported types in method params or results).
-
type foo interface {}
should be ignored (unexported type) -
type Foo interface { foo() }
should be ignored (unexported method) -
type Foo interface { Foo(f foo) }
should be ignored (unexported type in param/return value)