Skip to content

Commit

Permalink
Remove builders support completely
Browse files Browse the repository at this point in the history
Summary: goodbye_sayonara_spock

Reviewed By: podtserkovskiy

Differential Revision: D57359732

fbshipit-source-id: eb37312f3369f94b2bec9df5bb5029ba571d4f7f
  • Loading branch information
echistyakov authored and facebook-github-bot committed May 18, 2024
1 parent 8821c0c commit 987d4b9
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class mstch_go_program : public mstch_program {
&mstch_go_program::thrift_metadata_import},
{"program:go_package_alias", &mstch_go_program::go_package_alias},
{"program:gen_metadata?", &mstch_go_program::should_gen_metadata},
{"program:gen_builders?", &mstch_go_program::should_gen_builders},
{"program:import_metadata_package?",
&mstch_go_program::should_import_metadata_package},
{"program:metadata_qualifier",
Expand Down Expand Up @@ -128,7 +127,6 @@ class mstch_go_program : public mstch_program {
return data_.get_go_package_alias(program_);
}
mstch::node should_gen_metadata() { return data_.gen_metadata; }
mstch::node should_gen_builders() { return data_.gen_builders; }
mstch::node should_import_metadata_package() {
// We don't need to import the metadata package if we are
// generating metadata inside the metadata package itself. Duh.
Expand Down Expand Up @@ -804,9 +802,6 @@ void t_mstch_go_generator::generate_program() {
if (auto gen_metadata = get_option("gen_metadata")) {
data_.gen_metadata = (gen_metadata.value() == "true");
}
if (auto gen_builders = get_option("gen_builders")) {
data_.gen_builders = (gen_builders.value() == "true");
}

const auto& prog = cached_program(program);
auto package_dir = std::filesystem::path{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,7 @@

{{! methods }}
{{> types/struct_methods}}
{{#program:compat?}}

{{! builder }}
{{#program:gen_builders?}}
{{> types/struct_builder}}
{{/program:gen_builders?}}
{{/program:compat?}}
{{#struct:resp?}}

{{! exception }}
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions third-party/thrift/src/thrift/compiler/lib/go/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ class codegen_data {
bool compat_setters = true;
// whether to generate Thrift metadata
bool gen_metadata = true;
// whether to generate struct builders
bool gen_builders = false;

// Records field names for every struct in the program.
// This is needed to resolve some edge case name collisions.
Expand Down

0 comments on commit 987d4b9

Please sign in to comment.