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

Generated Go code produces name collisions on imports

    XMLWordPrintableJSON

    Details

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

      Description

      If two modules have the same name, the produced go code will not compile.

      For example:

      import (
        "github.com/sample/project/common"
        "github.com/different/thing/common"
      )

      In go the final component (commons) is used as the name so there is a collision.

      This can be fixed by aliasing the modules

      import (
        common_1 "github.com/sample/project/common"
        common_2 "github.com/different/thing/common"
      )

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                qix Josh Yudaken
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m