You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jens Geyer (JIRA)" <ji...@apache.org> on 2015/11/05 22:43:27 UTC
[jira] [Commented] (THRIFT-3411) Go generates remotes with wrong
package qualifiers when including
[ https://issues.apache.org/jira/browse/THRIFT-3411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14992537#comment-14992537 ]
Jens Geyer commented on THRIFT-3411:
------------------------------------
{code:title=base.thrift}
namespace go my_base
struct BaseThing {
1:string foo,
}
{code}
{code:title=expanded.thrift}
include "base.thrift"
namespace go expanded
service MyService {
void getNow(1:base.BaseThing t1)
}
{code}
> Go generates remotes with wrong package qualifiers when including
> -----------------------------------------------------------------
>
> Key: THRIFT-3411
> URL: https://issues.apache.org/jira/browse/THRIFT-3411
> Project: Thrift
> Issue Type: Bug
> Components: Go - Compiler
> Affects Versions: 1.0
> Reporter: Eric Klaus
>
> The Go Thrift compiler assumes that all service methods use only types from the same namespace. If a service method uses a type from an included Thrift file, the compiler still attempts to refer to the type using the calling file's namespace.
> *Steps to reproduce:*
> 1. Create a new directory/project
> 2. Copy the files in the gist to the directory (https://gist.github.com/ericklaus-wf/d986c6ab00e03fa935e3)
> 3. Generate Go code using Thrift
> 4. Examine the gen-go/expanded/my_service-remote/my_service-remote.go file
> 5. Line 133 refers to `expanded.NewBaseThing()` which does not exist.
> Expected:
> Line 133 should use `my_base.NewBaseThing` and an import for `my_base` should be present.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)