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

Service remote tool does not import stub package with package prefix

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.9.2
    • Fix Version/s: 0.9.3
    • Component/s: Go - Compiler
    • Labels:
      None
    • Environment:

      Go 1.4.2

    • Patch Info:
      Patch Available

      Description

      When generating code with package_prefix option, the generated service remote tool does not import generated package with given package prefix.

      For example, generate Go code for the following thrift:

      namespace go testpkgprefix.api.thrift_gen
      
      service TestPkgPrefix {
      	string echo(1: required string msg);
      }
      

      with command:

      thrift --gen go:package_prefix=repo.local/user/ -out src/repo.local/user -v idl/testpkgprefix.thrift
      

      The resulted Go code will resides in src/repo.local/user/testpkgprefix/api/thrift_gen.

      But the import statement of service remote tool ( src/repo.local/user/testpkgprefix/api/thrift_gen/test_pkg_prefix-remote/test_pkg_prefix-remote.go ) will be:

      import (
      	... // skip
      	"testpkgprefix/api/thrift_gen"
      	... // skip
      

      instead of:

      import (
      	... // skip
      	"repo.local/user/testpkgprefix/api/thrift_gen"
      	... // skip
      

      This issue prevents some tool which does full build (build with ./...) from function normally.

        Attachments

          Activity

            People

            • Assignee:
              jensg Jens Geyer
              Reporter:
              yinyin Yinyin L

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment