[
https://issues.apache.org/jira/browse/THRIFT-4610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16569332#comment-16569332
]
Ermolay Romanov edited comment on THRIFT-4610 at 8/5/18 1:55 AM:
-----------------------------------------------------------------
[~calcifer] that's what I am saying, I have no idea where that import comes
from — it is not my creation nor do I want it there.
I see that I an issue may be that I have not included the -r flag when
generating code.
was (Author: ermolay):
[~calcifer] that's what I am saying, I have no idea where that import comes
from — it is not my creation nor do I want it there.
Are you saying that to use "include" statements when doing codegen I have to
run a shell script that would run --gen go on both the importer and the
importee files?
> [GO] Include directive compiles to language-default import
> ----------------------------------------------------------
>
> Key: THRIFT-4610
> URL: https://issues.apache.org/jira/browse/THRIFT-4610
> Project: Thrift
> Issue Type: Question
> Components: Go - Compiler
> Affects Versions: 0.11.0
> Reporter: Ermolay Romanov
> Priority: Critical
>
> Thrift IDL utilizing an `include` statement such as:
> {code:java}
> include "shared.thrift"{code}
> creates a golang package that has:
> {code:java}
> import (
> ...
> "shared"
> ...
> ){code}
> code.
>
> In addition to that, if passing a package= directive to the CLI:
> {code:java}
> thrift --gen go:package=mommy{code}
> 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.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)