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

Service remote tool does not import stub package with package prefix

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.9.2
    • 0.9.3
    • Go - Compiler
    • None
    • Go 1.4.2

    • 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

            jensg Jens Geyer
            yinyin Yinyin L
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: