Skip to content

Commit

Permalink
update rpcmetadata namespace to an open source friendly one
Browse files Browse the repository at this point in the history
Summary:
update rpcmetadata namespace to an open source friendly one

This way we can avoid copying the code into thrift/lib/go/thrift in future and rather import the generated code

Reviewed By: podtserkovskiy

Differential Revision: D63014121

fbshipit-source-id: 74d08d3f03dd0d228b95882a24826790354f871d
  • Loading branch information
Walter Schulze authored and facebook-github-bot committed Sep 19, 2024
1 parent 92c1da5 commit b66adc8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ std::vector<t_annotation> get_fatal_annotations(
}

std::string get_fatal_string_short_id(const std::string& key) {
return boost::algorithm::replace_all_copy(key, ".", "_");
return boost::algorithm::replace_all_copy(
boost::algorithm::replace_all_copy(key, ".", "_"), "/", "_");
}
std::string get_fatal_string_short_id(const t_named* node) {
// Use the unmodified cpp name.
Expand All @@ -144,6 +145,7 @@ std::string get_fatal_namespace_name_short_id(
const std::string& lang, const std::string& ns) {
std::string replacement = lang == "cpp" || lang == "cpp2" ? "__" : "_";
std::string result = boost::algorithm::replace_all_copy(ns, ".", replacement);
result = boost::algorithm::replace_all_copy(result, "/", "_");
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace php Thrift_RpcMetadata
namespace py thrift.lib.thrift.RpcMetadata
namespace py.asyncio thrift.lib.thrift.asyncio.RpcMetadata
namespace py3 thrift.lib.thrift
namespace go thrift.lib.thrift.rpcmetadata
namespace go 'github.com/facebook/fbthrift/thrift/lib/thrift/rpcmetadata'

include "thrift/annotation/thrift.thrift"
include "thrift/annotation/cpp.thrift"
Expand Down

0 comments on commit b66adc8

Please sign in to comment.