-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrongfully unqualified types in generated file #3
Comments
@benma the bigger issue is with mixing two packages (
package main
type Foo struct{}
//go:generate goautomock -mock-name fooMock -mock-pkg main_test -o mock.auto_test.go fooInterface
type fooInterface interface {
Foo() Foo
}
func main() {}
Do you want to look into the code to add support for folders with two packages? |
Thanks for the quick response. This is a Maybe this is the bug then? The tool should allow the unit test package to be in the same folder, and correctly import the types from (main.Foo). |
Yes, the bigger bug is allowing a I never use |
I confirm that it works if the generated file of a different package lives in another folder. Do you plan on fixing the bug to enable |
I'm travelling the next few weeks, so it will take some time for me to be able to review it. If you want to give it a try, I will be happy to answer questions and review the PR :) |
Thanks. I made a PR. |
@ernesto-jimenez, what is the status of this? |
Bump :) |
Hi
Example input:
After running
go generate ./...
, this file is generated:In the generated file, the main package is imported, but the mock of Foo has an error:
func (m *fooMock) Foo() Foo
should befunc (m *fooMock) Foo() main.Foo
.The text was updated successfully, but these errors were encountered: