Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-3023

Go compiler is a little overly conservative with names of attributes

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.2
    • Fix Version/s: 0.9.3
    • Component/s: Go - Compiler
    • Labels:
      None
    • Patch Info:
      Patch Available

      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:-

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

        Attachments

          Activity

            People

            • Assignee:
              jensg Jens Geyer
              Reporter:
              magrath Paul Magrath
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: