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/03/05 21:58:39 UTC

[jira] [Updated] (THRIFT-3023) Go compiler is a little overly conservative with names of attributes

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

Jens Geyer updated THRIFT-3023:
-------------------------------
    Description: 
Go compiler, in attempting to avoid using variable names that are reserved words in Go, is being a little overly conservative. 

For example, if you have a struct like this:-

{code}
struct NamesTest {
		1: required string type
}
{code}

One would expect it to compile to:-

{code}
type NamesTest struct {
	Type string `thrift:"type,1,required" json:"type"`
}
{code}

Rather than:-

{code}
type NamesTest struct {
	TypeA1 string `thrift:"type,1,required" json:"type"`
}
{code}


  was:
Go compiler, in attempting to avoid using variable names that are reserved words in Go, is being a little overly conservative. 

For example, if you have a struct like this:-

struct NamesTest {
		1: required string type
}

One would expect it to compile to:-

type NamesTest struct {
	Type string `thrift:"type,1,required" json:"type"`
}

Rather than:-

type NamesTest struct {
	TypeA1 string `thrift:"type,1,required" json:"type"`
}


> Go compiler is a little overly conservative with names of attributes
> --------------------------------------------------------------------
>
>                 Key: THRIFT-3023
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3023
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Go - Compiler
>    Affects Versions: 0.9.2
>            Reporter: Paul Magrath
>
> Go compiler, in attempting to avoid using variable names that are reserved words in Go, is being a little overly conservative. 
> For example, if you have a struct like this:-
> {code}
> struct NamesTest {
> 		1: required string type
> }
> {code}
> One would expect it to compile to:-
> {code}
> type NamesTest struct {
> 	Type string `thrift:"type,1,required" json:"type"`
> }
> {code}
> Rather than:-
> {code}
> type NamesTest struct {
> 	TypeA1 string `thrift:"type,1,required" json:"type"`
> }
> {code}



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