Closed joy717 closed 2 years ago
It's worked great.
That's my fault.
I'm using go module. the package name in -aux_files
was misconfigured
It's worked great. It was the wrong package name that caused the problem.
On Tue, Jul 26, 2022 at 6:31 PM Yuu177 @.***> wrote:
I have the same problem, how did you solve it?
— Reply to this email directly, view it on GitHub https://github.com/golang/mock/issues/638#issuecomment-1195305429, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACLYDDNVEWZIUVXJN2Z5NDVV646LANCNFSM5UKTUQDQ . You are receiving this because you modified the open/close state.Message ID: @.***>
hey, I got the same problem, the command below still not work, how did you solve the problem?
mockgen -source test2.go -destination test2_mocks.go -package test -aux_files=github.com/anyuser/test=test1.go
what did you mean misconfigure package name?
hey, I got the same problem, the command below still not work, how did you solve the problem?
mockgen -source test2.go -destination test2_mocks.go -package test -aux_files=github.com/anyuser/test=test1.go
what did you mean misconfigure package name?
I worte a wrong package name.
-aux_files $PACKAGE_NAME=$REAL_LOCATION_OF_FILE
the $REAL_LOCATION_OF_FILE is based on the path of mocken xxxx
command executed.
for example:
if I executed mockgen -source test2.go ...
in the location github.com/anyuser/
,
-aux_files github.com/anyuser/test=../test1.go
but if I exected mockgen -source test2.go ...
in the location github.com/anyuser/test/
,
then
-aux_files github.com/anyuser/test=test1.go
this issue is the same with https://github.com/golang/mock/issues/178 the
sourceFile
and theEmbededFile
are in the same package but are different files.even use this command, still got an error:
I know there is another issue: https://github.com/golang/mock/issues/85 but #85 is two files in two packages.
gomock version: 1.6.0