Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-3170 Initialism code in the Go compiler causes chaos
  3. THRIFT-3174

Initialism code in the Go compiler doesn't check first word

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.9.3
    • Fix Version/s: 0.9.3
    • Component/s: Go - Compiler
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      The Go compiler, when checking for common initialisms in the process of converting to camelcase, fails to check the first word of the name, only checking the subsequent words. As such, if you have a Thrift struct like:-

      struct Foo {
          1: string user_id,
          2: string server_url,
          3: string id, 
      }
      

      You get a Go struct of the form:-

      type Foo struct {
      	UserID    string `thrift:"user_id,1" json:"user_id"`
      	ServerURL string `thrift:"server_url,2" json:"server_url"`
      	Id        string `thrift:"id,3" json:"id"`
      }
      

      Instead of:-

      type Foo struct {
      	UserID    string `thrift:"user_id,1" json:"user_id"`
      	ServerURL string `thrift:"server_url,2" json:"server_url"`
      	ID        string `thrift:"id,3" json:"id"`
      }
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: