nelsam / hel

Hel rules over Helheim, where the souls unworthy of Valhalla reside. It's also a mock generator for Go.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creates Mocks for Unexported Types When Not In Same Package

nelsam opened this issue · comments

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)