【问题标题】:Thrift Compiler(0.9.3) Generates Function thrift.PrependError Which is Undefined In Thrift PackageThrift Compiler(0.9.3) 生成函数 thrift.PrependError 在 Thrift 包中未定义
【发布时间】:2016-09-15 18:02:26
【问题描述】:

我使用thrift编译器(0.9.3)生成gen-go文件夹,而编译器生成一个函数thrift.PrependErrorthrift包(git.apache.org/thrift.git/lib/go/thrift)中找不到。

我应该使用thrift 编译器(0.9.2)吗?

【问题讨论】:

    标签: go compilation thrift


    【解决方案1】:

    在 Thrift 0.9.3 中添加了前置错误,并且存在于当前代码库中:

    https://github.com/apache/thrift/blob/53dd39833a08ce33582e5ff31fa18bb4735d6731/lib/go/thrift/exception.go

    https://github.com/apache/thrift/commit/527b6d9c86a7e5cde14cbb09a0e3103be0791c3a#diff-d28b48f0840fec65d4a9ece357194970R32

    如果在您的本地库中找不到它,您需要更新本地(或供应商)版本的 Thrift。

    请记住,您的 thrift 生成器二进制文件(在 /usr/local/bin/thrift 中)可以是与您在 $GOPATH 中的软件包不同的版本。始终确保将两者一起更新。

    【讨论】:

      【解决方案2】:

      我应该使用 thrift 编译器 (0.9.2) 吗?

      您应该确保并仔细检查 Thrift 编译器的版本与所使用的 Thrift 库的版本匹配。 Thrift 编译器生成的代码和库代码相互依赖,它们是同一个难题的两个部分。您使用的 Thrift 版本无关紧要,只要您保持一致即可。

      除此之外,目前的稳定版是0.9.3,这也是推荐的版本。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-04-29
        • 1970-01-01
        • 1970-01-01
        • 2013-02-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-11-17
        相关资源
        最近更新 更多