rules_go icon indicating copy to clipboard operation
rules_go copied to clipboard

Extend gomock to allow passing an `source_importpath` instead of `library` when operating in source mode

Open ramenjosh opened this issue 3 years ago • 5 comments

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

ramenjosh avatar Nov 14 '22 23:11 ramenjosh

@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 avatar Nov 17 '22 00:11 ramenjosh

@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 avatar Nov 17 '22 02:11 fmeum

@fmeum Can we revive that change? The issue is still present. Thanks.

therve avatar Jan 09 '24 10:01 therve

Sure, I can review this if someone can resolve the conflicts. The flaky tests should be gone now.

fmeum avatar Jan 09 '24 10:01 fmeum

Thanks, created #3822.

therve avatar Jan 09 '24 11:01 therve