How am I supposed to install mockgen when I am using vendoring?

28 views Asked by At

I have a project that is using vendoring.

I need to run mockgen. But I can't use my local install because of the vendoring. Fair enough, I would like to package mockgen into vendor.

However the usual

go get github.com/golang/mock/mockgen
go mod tidy
go mod vendor

will not do anything unless the package is imported into my code. However, mockgen is not an import, it is a program. And if I try importing it, I get a red squiggly.

Im not sure if it compiles with the red squiggly tho, I did not try.

At least when I import mockgen, go vendors it.

What am I supposed to do here?

0

There are 0 answers