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

Go generates remotes with wrong package qualifiers when including

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.10.0
    • Component/s: Go - Compiler
    • Labels:
      None

      Description

      The Go Thrift compiler assumes that all service methods use only types from the same namespace. If a service method uses a type from an included Thrift file, the compiler still attempts to refer to the type using the calling file's namespace.

      Steps to reproduce:
      1. Create a new directory/project
      2. Copy the files in the gist to the directory (https://gist.github.com/ericklaus-wf/d986c6ab00e03fa935e3)
      3. Generate Go code using Thrift
      4. Examine the gen-go/expanded/my_service-remote/my_service-remote.go file
      5. Line 133 refers to `expanded.NewBaseThing()` which does not exist.

      Expected:
      Line 133 should use `my_base.NewBaseThing` and an import for `my_base` should be present.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jensg Jens Geyer
                Reporter:
                etklaus Eric Klaus
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: