Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to recently introduced sourceinfo stuff #500

Merged
merged 3 commits into from
Feb 17, 2022

Conversation

jhump
Copy link
Owner

@jhump jhump commented Feb 17, 2022

The biggest change here is that desc.Load* functions will always add source code info to the returned descriptors, if available.

So the desc package now works "out of the box" to include source info if you are also using the protoc-gen-gosrcinfo plugin. And for users of the v2 protobuf API, one can swap in sourceinfo.GlobalFiles in place of protoregistry.GlobalFiles.

This PR also tweaks the output of protoc-gen-gosrcinfo, to eliminate an unnecessary import alias. And it adds a comment about the fact that the srcinforeflection package is experimental. With luck, a change can instead be upstreamed into the core gRPC reflection implementation that allows easily injecting sourceinfo.GlobalFiles.

@jhump jhump merged commit 1837b10 into master Feb 17, 2022
@jhump jhump deleted the jh/always-include-source-code-info-if-available branch February 17, 2022 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant