Apache Thrift 0.9.1 生成 Golang 代码时,参数 -r 不起作用。

huangapple go评论75阅读模式
英文:

Apache Thrift 0.9.1 generate golang code , param -r don't work

问题

我使用thrift-0.9.1 -r -gen go aaa.thrift来生成Golang代码。

注意:aaa.thrift包含了定义了"Body"结构体的bbb.thrift。

参数-r似乎不起作用,在ttypes.go中找不到"Body"结构体。

但是当我尝试使用thrift-0.9.1 -r -gen java aaa.thrift时,会生成"Body.java"。

请问如何生成包含文件的Golang代码?

(注:来自https://github.com/apache/thrift


我知道原因了,namespace go service.demo导致了这个问题。

英文:

I use

`thrift-0.9.1 -r -gen go aaa.thrift` 

to generate golang code

(note: aaa.thrfit include bbb.thrift which defined "Body" struct)

the param -r seems doesn't work, can't find "Body" struct in ttypes.go,

but when I try to use

`thrift-0.9.1 -r -gen java aaa.thrift`

has "Body.java",

how can I generate golang code which included files?
(note:from https://github.com/apache/thrift)


I know the reason, namespace go service.demo lead to the problem

答案1

得分: 1

以下是翻译好的内容:

$ cd thrift
$ cd trunk
$ cd tutorial
$ thrift -r -gen go tutorial.thrift

对我来说完美运行。
英文:
$ cd thrift
$ cd trunk
$ cd tutorial
$ thrift -r -gen go tutorial.thrift

works perfectly for me.

huangapple
  • 本文由 发表于 2014年1月7日 10:45:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/20963055.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定