summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorYuxuan 'fishy' Wang <yuxuan.wang@reddit.com>2022-05-09 11:05:11 -0700
committerYuxuan 'fishy' Wang <fishywang@gmail.com>2022-05-10 08:57:22 -0700
commitdae1437ca03834527b654cf5bc8d7f41c9412a20 (patch)
treecabf29b8f24514d3b2df851e0070be9868064878 /compiler
parenta24bcd39a50e3472b5f1bf9fb5b8526fccf7911e (diff)
downloadthrift-dae1437ca03834527b654cf5bc8d7f41c9412a20.tar.gz
THRIFT-5583: Add skip_remote arg to go compiler
Client: go
Diffstat (limited to 'compiler')
-rw-r--r--compiler/cpp/src/thrift/generate/t_go_generator.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/compiler/cpp/src/thrift/generate/t_go_generator.cc b/compiler/cpp/src/thrift/generate/t_go_generator.cc
index 020297b9b..4833420c9 100644
--- a/compiler/cpp/src/thrift/generate/t_go_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_go_generator.cc
@@ -83,6 +83,7 @@ public:
package_flag = "";
read_write_private_ = false;
ignore_initialisms_ = false;
+ skip_remote_ = false;
for( iter = parsed_options.begin(); iter != parsed_options.end(); ++iter) {
if( iter->first.compare("package_prefix") == 0) {
gen_package_prefix_ = (iter->second);
@@ -94,6 +95,8 @@ public:
read_write_private_ = true;
} else if( iter->first.compare("ignore_initialisms") == 0) {
ignore_initialisms_ = true;
+ } else if( iter->first.compare("skip_remote") == 0) {
+ skip_remote_ = true;
} else {
throw "unknown option go:" + iter->first;
}
@@ -297,6 +300,7 @@ private:
std::string gen_thrift_import_;
bool read_write_private_;
bool ignore_initialisms_;
+ bool skip_remote_;
/**
* File streams
@@ -2015,7 +2019,9 @@ void t_go_generator::generate_service(t_service* tservice) {
generate_service_client(tservice);
generate_service_server(tservice);
generate_service_helpers(tservice);
- generate_service_remote(tservice);
+ if(!skip_remote_) {
+ generate_service_remote(tservice);
+ }
f_types_ << endl;
}
@@ -4267,4 +4273,6 @@ THRIFT_REGISTER_GENERATOR(go, "Go",
" ignore_initialisms\n"
" Disable automatic spelling correction of initialisms (e.g. \"URL\")\n" \
" read_write_private\n"
- " Make read/write methods private, default is public Read/Write\n")
+ " Make read/write methods private, default is public Read/Write\n"
+ " skip_remote\n"
+ " Skip the generating of -remote folders for the client binaries for services\n")