Actual behavior A clear and concise description of what the bug is.
I am working on migrating a dep based go project to mod. After doing a bit of refactoring generating the go.mod, I run the go mod tidy and that is working fine. But to completely build the code, in need to include the compiled protos and the mocks, i am able to compile the protos using the protoc command, but when i try to generate the mocks using mockgen the in interfaces in the *.pb.go files, generated but protoc command, I get the below error. this was working previously when the project was dep based.
I am working on migrating a dep based go project to mod. After doing a bit of refactoring generating the go.mod, I run the go mod tidy and that is working fine. But to completely build the code, in need to include the compiled protos and the mocks, i am able to compile the protos using the protoc command, but when i try to generate the mocks using mockgen the in interfaces in the *.pb.go files, generated but protoc command, I get the below error. this was working previously when the project was dep based.
the package structure is shown as below. In this the protos folder has all the compiled .protos.
root@xxxx:~/gomod_sm_master/microservice/sm_service_v2/pkg# ls -lrt
total 240
-rw-r--r-- 1 root root 2267 Nov 5 04:42 README.md
-rw-r--r-- 1 root root 1655 Nov 5 04:42 Gopkg.toml_bkp
-rw-r--r-- 1 root root 12877 Nov 5 04:42 Gopkg.lock_bkp
-rw-r--r-- 1 root root 6283 Nov 5 04:42 change.log
drwxr-xr-x 2 root root 4096 Nov 5 04:42 cassandraSanity
drwxr-xr-x 3 root root 4096 Nov 5 04:42 migrations
drwxr-xr-x 2 root root 4096 Nov 5 04:42 logger
drwxr-xr-x 4 root root 4096 Nov 5 04:42 constants
drwxr-xr-x 2 root root 4096 Nov 5 04:42 conf
drwxr-xr-x 2 root root 4096 Nov 5 04:42 mockServer
drwxr-xr-x 2 root root 4096 Nov 5 04:42 smDbCassandra
drwxr-xr-x 2 root root 4096 Nov 5 04:42 serviceimpl
drwxr-xr-x 2 root root 4096 Nov 5 04:42 s3Access
drwxr-xr-x 2 root root 4096 Nov 5 04:42 rpc
drwxr-xr-x 3 root root 4096 Nov 5 04:42 testutils
-rw-r--r-- 1 root root 8358 Nov 5 04:42 smService.go
drwxr-xr-x 5 root root 4096 Nov 5 04:42 smInputValidation
drwxr-xr-x 10 root root 4096 Nov 5 04:42 smDialers
drwxr-xr-x 2 root root 4096 Nov 5 04:42 util
-rwxr-xr-x 1 root root 1722 Nov 5 04:57 generateMock.sh
drwxr-xr-x 12 root root 4096 Nov 5 04:57 mock_Client
drwxr-xr-x 2 root root 4096 Nov 5 05:57 services
drwxr-xr-x 2 root root 4096 Nov 5 05:57 commonFunctions
drwxr-xr-x 13 root root 4096 Nov 5 05:59 protos
drwxr-xr-x 8 root root 4096 Nov 5 05:59 vendor
-rw-r--r-- 1 root root 112607 Nov 5 06:21 go.sum
-rw-r--r-- 1 root root 1228 Nov 5 06:21 go.mod
the command to generate the protos is as below.
protoc -I ./ -I ./subscriptionManagement ${PROTOS} ${OPTS} --go_out=plugins=grpc${PACKAGES}:${OUTDIR}
${PROTOS}= list of protos
${OPTS}=" --go_opt=paths=source_relative "
${PACKAGES}= path in which the protos have to be importer. eg.
PACKAGES=,Mcommon/resultCodes/result.proto=${PROTO_PACKAGE}/common/resultCodes
PACKAGES+=,Mxx/common/common.proto=${PROTO_PACKAGE}/dm/common
PACKAGES+=,Mcommon/token/token.proto=${PROTO_PACKAGE}/common/token
${PROTO_PACKAGE} = path in which proto has to be imported.
Actual behavior A clear and concise description of what the bug is.
I am working on migrating a dep based go project to mod. After doing a bit of refactoring generating the go.mod, I run the go mod tidy and that is working fine. But to completely build the code, in need to include the compiled protos and the mocks, i am able to compile the protos using the protoc command, but when i try to generate the mocks using mockgen the in interfaces in the *.pb.go files, generated but protoc command, I get the below error. this was working previously when the project was dep based.
I am working on migrating a dep based go project to mod. After doing a bit of refactoring generating the go.mod, I run the go mod tidy and that is working fine. But to completely build the code, in need to include the compiled protos and the mocks, i am able to compile the protos using the protoc command, but when i try to generate the mocks using mockgen the in interfaces in the *.pb.go files, generated but protoc command, I get the below error. this was working previously when the project was dep based.
the package structure is shown as below. In this the protos folder has all the compiled .protos.
the command to generate the protos is as below.
Also the go.mod content
Kindly help. Also pls comment if any other info needed. TIA Expected behavior A clear and concise description of what you expected to happen.
To Reproduce Steps to reproduce the behavior
Additional Information