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

[GO] Include directive compiles to language-default import

    XMLWordPrintableJSON

Details

    • Question
    • Status: Closed
    • Minor
    • Resolution: Invalid
    • 0.11.0
    • None
    • Go - Compiler
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: