Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
OS X, go1.4.2
Description
Running against Thrift master branch at revision ff4a8ed, a service with a name starting with "New" results in some generated code having an extra underscore, and thus not correctly referring to a defined datatype.
In the example below, to simple services are created, one names "Something" and the other "Newsomething".
Note in the "Newsomething" service, the generated type is newsomethingProcessorFunc while in NewNewsomething_Processor it is referred to as newsomething_ProcessorFunc which fails to compile.
################################ # file s.thrift service Something { void func(1: i64 i) } service Newsomething { void func(1: i64 i) } ################################ $ thrift thrift -out gen --gen go s.thrift ################################ # file gen/s/something.go func NewSomethingProcessor(handler Something) *SomethingProcessor { ... self7.processorMap["func"] = &somethingProcessorFunc{handler: handler} ... } type somethingProcessorFunc struct { ... ################################ # file gen/s/newsomething.go func NewNewsomething_Processor(handler Newsomething_) *Newsomething_Processor { ... self2.processorMap["func"] = &newsomething_ProcessorFunc{handler: handler} ... } type newsomethingProcessorFunc struct { ...
$ thrift --version Thrift version 1.0.0-dev $ go version go version go1.4.2 darwin/amd64