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)?

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.

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.