You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/03/05 12:32:38 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=14348635#comment-14348635 ] 

ASF GitHub Bot commented on THRIFT-3023:
----------------------------------------

GitHub user Magrath opened a pull request:

    https://github.com/apache/thrift/pull/389

    THRIFT-3023 Only make variable Go safe if we aren't publicising it

    Publicising it will make it safe as all reserved keywords are lowercase so there is no need to execute variable_name_to_go_name if the output will then be passed to publicize.
    
    https://issues.apache.org/jira/browse/THRIFT-3023

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Magrath/thrift THRIFT-3023

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/389.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #389
    
----
commit e9a79f80e717d2beda65a2aae3709372d8618ec6
Author: Paul Magrath <pa...@swiftkey.com>
Date:   2015-03-05T11:29:21Z

    THRIFT-3023 Only make variable Go safe if we aren't publicising it (publicising it will make it safe as all reserved keywords are lowercase)

----


> 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:-
> 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"`
> }



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