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

[GO] Include directive compiles to language-default import

    XMLWordPrintableJSON

    Details

    • Type: Question
    • Status: Closed
    • Priority: Minor
    • Resolution: Invalid
    • Affects Version/s: 0.11.0
    • Fix Version/s: None
    • Component/s: Go - Compiler
    • Labels:
      None

      Description

      Thrift IDL utilizing an `include` statement such as:

      include "shared.thrift"

      creates a golang package that has:

      import (
          ...
          "shared"
          ...
      )

      code.

       

      In addition to that, if passing a package= directive to the CLI:

      thrift --gen go:package=mommy

      the resulting code has an import of the root "mommy" package — I think it replaces not only the gen-go package name with whatever is passed to the CLI but also the name of that import. So it basically tries to import itself.

       

      Expected: the code generator would pull needed imports and bundle them with the generated Go code, removing any need for importing anything further.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ermolay Ermolay Romanov
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: