You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jens Geyer (JIRA)" <ji...@apache.org> on 2015/09/21 23:15:05 UTC

[jira] [Assigned] (THRIFT-3338) Stray underscore in generated go when service name starts with "New"

     [ https://issues.apache.org/jira/browse/THRIFT-3338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jens Geyer reassigned THRIFT-3338:
----------------------------------

    Assignee: Jens Geyer

> Stray underscore in generated go when service name starts with "New"
> --------------------------------------------------------------------
>
>                 Key: THRIFT-3338
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3338
>             Project: Thrift
>          Issue Type: Bug
>          Components: Go - Compiler
>    Affects Versions: 1.0
>         Environment: OS X, go1.4.2
>            Reporter: Patrick Mahoney
>            Assignee: Jens Geyer
>            Priority: Minor
>
> Running against Thrift master branch at revision [ff4a8ed|https://git-wip-us.apache.org/repos/asf?p=thrift.git;a=commit;h=ff4a8edd50621fb6aab7dbbf6968d4322700ed7d], 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.
> {code}
> ################################
> # 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 {
> ...
> {code}
> {code}
> $ thrift --version
> Thrift version 1.0.0-dev
> $ go version
> go version go1.4.2 darwin/amd64
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)