fishy commented on code in PR #3971:
URL: https://github.com/apache/thrift/pull/3971#discussion_r4212181735
##########
compiler/cpp/src/thrift/generate/t_go_generator.cc:
##########
@@ -457,6 +457,19 @@ void t_go_generator::init_generator() {
package_dir_ = get_out_dir();
last_const_block_ = 0;
+ // The -remote stub's main() declares these local variables. An imported
package with one of
+ // these names would be shadowed by them, so reserve them before any import
is rendered; such a
+ // package is then imported under an alias in every file of this program.
+ if (!skip_remote_) {
+ for (const char* local :
+ {"cfg", "client", "cmd", "err", "framed",
"headers",
+ "host", "httptrans", "iprot", "m", "oprot",
"parsedUrl",
+ "parts", "port", "portStr", "protocol", "protocolFactory",
"trans",
+ "urlString", "useHttp"}) {
+ package_identifiers_set_.insert(local);
Review Comment:
`package_identifiers_set_` is actually global so this impacts more than the
`-remote` code? do we have a way to only do this for the `-remote` part?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]