Extend gomock to allow passing an `source_importpath` instead of `library` when operating in source mode
What type of PR is this?
Feature
What does this PR do? Why is it needed?
This PR adds a new parameter, importpath to the gomock rule. This parameter is optional, and allows a gomock target running in source mode to avoid depending on a go_library. As far as I can see, the only use for the go_library in source mode is to extract an importpath.
I've also extended the test cases to test the different modes gomock can operate in, and made sure there's a link to gomock on the top level README.
Which issues(s) does this PR fix?
Fixes #3349
@fmeum @linzhp can you please take another review? There's still one part of the CI that seems to be failing and I'm not super sure why, any tips on what might be causing it?
@ramenjosh To be honest, I have no idea what is causing that failure. Could you amend and force-push your branch to trigger a new CI run? It may just be a flake.
@fmeum Can we revive that change? The issue is still present. Thanks.
Sure, I can review this if someone can resolve the conflicts. The flaky tests should be gone now.
Thanks, created #3822.