Closed monikakatiyar16 closed 7 years ago
Hi,
Do you think you could help me better understand this issue with an example?
Thanks, Hesky
@balshetzer
I have a requirement to build without some C dependencies, which can be achieved by providing build tags.
During go build, by using: go build --tags "exclude_graphdriver_btrfs" For running ginkgo tests, by using: ginkgo --tags "exclude_graphdriver_btrfs"
These build tags avoid the compilation of the go files containing these tags as comments, by not passing it to the compiler. So, these commands work for my use case, without installing the C dependency.
Running mockgen without these C dependencies gives an error. So, though I can build the application without the dependencies, for running mockgen I have to install the dependencies for the app to build correctly via mockgen. In this case, I have to install the btrfs-tools package on ubuntu system for running mockgen.
I might be missing something. Please correct me, in that case.
When you run mockgen, do you use "source mode" (using the --source flag) or "reflect mode"?
We use the reflect mode. (just like: mockgen database/sql/driver Conn,Driver)
Please try #78 to see if it fixes this problem. You would need to add --build_flags='--tags=exclude_graphdriver_brtfs'
to your mockgen command.
Yeah.. With #78 changes, it works like a charm.. Thanks..!
We have a project which excludes some C dependencies by running go build as go build --tags "tag1 tag2 tag3". Running ginkgo with ginkgo --tags "tag1 tag2 tag3". However, we couldn't find such option with mockgen. Is there any way to achieve that with mockgen?