As the readme on their github repo, there are some workaround solutions:
Include an empty import import _ "github.com/golang/mock/mockgen/model".
Add --build_flags=--mod=mod to your mockgen command.
I had the same error as you and I did the second one successfully. mockgen -build_flags=--mod=mod -package mockdb -destination db/mock/store.go github.com/phihdn/simplebank/db/sqlc Store
thank you so so much, I registered just here to say thank you. How are you able to find this solution? I searched for long didn't find a usable solution lol
As the readme on their github repo, there are some workaround solutions:
import _ "github.com/golang/mock/mockgen/model"
.--build_flags=--mod=mod
to your mockgen command.I had the same error as you and I did the second one successfully.
mockgen -build_flags=--mod=mod -package mockdb -destination db/mock/store.go github.com/phihdn/simplebank/db/sqlc Store
thank you so so much, I registered just here to say thank you. How are you able to find this solution? I searched for long didn't find a usable solution lol
Hi, I don't remember. It might be Google or I might walk around their github Issues page. Then I found it in the readme. :) happy to hear it helps.