Closed amatoenot closed 6 years ago
Previous closed same issue: https://github.com/golang/mock/issues/85
@amatoenot
Hi Sergey,
The command line for aux_files needs the full package name:
mockgen -source test2.go -destination test2_mocks.go -package test -aux_files=github.com/anyuser/test=test1.go
Also, you mentioned in #85 that you used reflect as a fallback. Please consider reflect mode as the first option to try and use source mode only if it can't work for some reason.
Finally, I opened #181 to look into eliminating the need for aux_files altogether.
Hi @balshetzer I encountered the same issue. Here are my files.
github.com/project/handler/init.go
package handler
type Handler interface {
adminHandler
}
github.com/project/handler/admin.go
package handler
type adminHandler interface {
Method()
}
Here's generation
mockgen -source init.go -package handler -aux_files=github.com/project/handler=admin.go -destination mock_handler.go
Here's the output
Loading input failed: init.go:88:2: unknown embedded interface adminHandler
i don't know what's wrong with my command. can you help?
If you are having an issue please open a new issue, this one was closed over two years ago, thanks.
Here are my test files:
github.com/anyuser/test/test1.go:
github.com/anyuser/test/test2.go:
Here's generation:
Error result: