dongshuo6503
dongshuo6503
2016-09-13 16:17

Thrift编译器(0.9.3)生成Thrift包中未定义的函数thrift.PrependError

已采纳

I use thrift compiler (0.9.3) to generate gen-go folder, while the compiler generates a function thrift.PrependError which can't be found in thrift package (git.apache.org/thrift.git/lib/go/thrift).

Should I use thrift compiler (0.9.2)?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

2条回答

  • doushi5913 doushi5913 5年前

    Prepend error was added in Thrift 0.9.3, and is present in the current codebase:

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

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

    If it isn't being found in your local library, you need to update your local (or vendored) version of Thrift.

    Remember, your thrift generator binary (in /usr/local/bin/thrift) can be a different version than the package you have in your $GOPATH. Always make sure you update the two together.

    点赞 评论 复制链接分享
  • duanfen2349 duanfen2349 5年前

    Should I use thrift compiler (0.9.2)?

    You should make sure and double-check that the version of the Thrift compiler matches the version of the Thrift library being used. The code generated by the Thrift compiler and the library code depend on each other, they are two pieces of the same puzzle. It does not matter what Thrift version you are using, as long as you are consistent.

    Aside from that, the curent stable is 0.9.3, this is also the recommended version.

    点赞 评论 复制链接分享