[
https://issues.apache.org/jira/browse/THRIFT-2491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13977683#comment-13977683
]
Aleksey Pesternikov commented on THRIFT-2491:
---------------------------------------------
well thats what underscore does:
{code}
/**
* Transforms a camel case string to an equivalent one separated by
underscores
* e.g. aMultiWord -> a_multi_word
* someName -> some_name
* CamelCase -> camel_case
* name -> name
* Name -> name
*/
std::string underscore(std::string in) {
in[0] = tolower(in[0]);
for (size_t i = 1; i < in.size(); ++i) {
if (isupper(in[i])) {
in[i] = tolower(in[i]);
in.insert(i, "_");
}
}
return in;
}
{code}
it is probably fine to replace {{underscore()}} with {{lowercase()}} so
SomeService goes into someservice.go
> unable to import generated ThriftTest service
> ---------------------------------------------
>
> Key: THRIFT-2491
> URL: https://issues.apache.org/jira/browse/THRIFT-2491
> Project: Thrift
> Issue Type: Bug
> Components: Go - Compiler
> Reporter: Aleksey Pesternikov
> Assignee: Jens Geyer
> Priority: Minor
>
> IDL compiler uses service name converted from camel case to underscores as a
> file name. service ThriftTest {} goes into thrift_test.go, which is not being
> compiled since the file match *_test.go mask.
--
This message was sent by Atlassian JIRA
(v6.2#6252)