Use "." to refer to the current path's package in reflect mode#387
Use "." to refer to the current path's package in reflect mode#387cvgw merged 3 commits intogolang:masterfrom
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
1 similar comment
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
|
@googlebot I signed it! |
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
1 similar comment
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
85f1249 to
17ebec6
Compare
|
Hey @XSAM, thanks for the PR. Is their a corresponding issue that goes with this PR? If not, could you please create one to discuss the feature. |
|
I created an issue. #388 |
|
@cvgw sure, now it generates |
|
@XSAM thank you for the contribution 🎉 |
Description
I use
go:generatein my source code to invokemockgento generate mocked interfaces.e.g.
//go:generate mockgen -destination=mocks/foo.pb.go github.com/xxx/xxx/pkg/xxx FooBut it's too annoying that every time I have to write and check the package name (github.com/xxx/xxx/pkg/xxx).
And add the full package name in a source file is kind of duplicated information since golang could parse the file path and get the package name.
So I add a feature that can use "." to refer to the current path's package.
e.g.
//go:generate mockgen -destination=mocks/foo.pb.go . FooJust a single
., no moregithub.com/xxx/xxx/pkg/xxx.Release Notes