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

Extra ending underscore with field ending with `result` for Golang

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Question
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • 0.10.0
    • None
    • Go - Compiler
    • None
    • macos high sierra

    Description

      Given a struct where fields ending with result

      struct Test {
          1: optional string id_result
          2: optional string name_result
          3: optional string full_description_result
          4: optional string image_url_result
      }
      

      The generated go codes are

      type Test struct {
        IDResult_ *string `thrift:"id_result,1" db:"id_result" json:"id_result,omitempty"`
        NameResult_ *string `thrift:"name_result,2" db:"name_result" json:"name_result,omitempty"`
        FullDescriptionResult_ *string `thrift:"full_description_result,3" db:"full_description_result" json:"full_description_result,omitempty"`
        ImageURLResult_ *string `thrift:"image_url_result,4" db:"image_url_result" json:"image_url_result,omitempty"`
      }
      

      I am expecting the field has the same name as defined (no undersore at the end).

      Thanks Jens Geyer for pointing out the codes, if anyone could en-light me about why IDL identifiers end with "Args"/"Result" interferes with the implicit service, that will be much appreciated!!

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            bobintornado Bob Cao

            Dates

              Created:
              Updated:

              Slack

                Issue deployment