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

Panic when generating mock in different package

myshkin5 opened this issue · comments

We are trying to land the mock in a package other than where the interface is defined.

my_interface.go

package xyz

//go:generate hel -o ../anotherpackage/mock_my_test.go -t MyInterface

type MyInterface interface {
    DoSomething() (err error)
}

I've got another potential solution for this. This sort of thing seems to come up when you're forced to use an imported interface type as a function parameter or return value - I can cover that situation by simply automatically generating a mock for those types.