FAQ
Can anyone confirm whether Thrift support for Go is officially up to date?
I was trying to get started with a new project, and was just testing out
the thrift generator and it seemed to produce code that isn't valid for Go
1.x? Mainly a lot of "err is shadowed during return" until it just failed.

I saw go-thrift, which comes with it's own generator, but it seems like you
have to write your spec file in Go as opposed to the thrift spec? It didn't
seems to want to parse my existing thrift spec file without a syntax error.

Then after search for Go 1.1 thrift support, I came across this:
http://code.google.com/p/thrift-go/

Not sure if this is maintained, or just something that someone threw out
there once, since it only has 2 commits.


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Notmikegibson at May 10, 2013 at 6:27 am
    Thrift 0.9.0 works fine for me with thrift4go. The official Go support is broken since go1.0.

    See:

    https://issues.apache.org/jira/browse/THRIFT-1600

    Thrift maintainer recently commented in there that he'd like to have go support patched for thrift 1.0.0. This would be great...

    https://github.com/pomack/thrift4go - follow readme for instructions

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Damian Gryski at May 10, 2013 at 6:50 am
    There's also a pure Go thrft implementation at github.com/Samuel/go-thrift . Not sure how it compares to the others though.

    Damian

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Ingo Oeser at May 10, 2013 at 4:33 pm
    That one is an excellent implementation, which feels really like Go. It
    just misses default cases,
    which are not recommended in such protocols anyway.

    If your primary code base it Go and you just want to make it easy for
    others to connect, that pure Go one is highly recommended.
    You can use normal readers and writers with it and have no additional
    transport and buffering layers generated and added, which Go already has.
    It also needs nothing besides Go itself and generates Code which can be
    augmented with further struct tags

    But if Go is just another use case you have to support and your main code
    base is PHP, Ruby, Java, Python and whatever, I would recommend to use the
    thrift compiler mentioned in other posts,
    as it provides the same tooling for every language supported.
    On Friday, May 10, 2013 8:50:24 AM UTC+2, Damian Gryski wrote:

    There's also a pure Go thrft implementation at github.com/Samuel/go-thrift. Not sure how it compares to the others though.

    Damian
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Buzzlight at May 10, 2013 at 6:51 am
    I prefer this package
    https://github.com/apesternikov/thrift4go

    the code generated by it is GO style, thrift-go is more like Java.



    在 2013年5月10日星期五UTC+8上午11时40分32秒,Justin Israel写道:
    Can anyone confirm whether Thrift support for Go is officially up to date?
    I was trying to get started with a new project, and was just testing out
    the thrift generator and it seemed to produce code that isn't valid for Go
    1.x? Mainly a lot of "err is shadowed during return" until it just failed.

    I saw go-thrift, which comes with it's own generator, but it seems like
    you have to write your spec file in Go as opposed to the thrift spec? It
    didn't seems to want to parse my existing thrift spec file without a syntax
    error.

    Then after search for Go 1.1 thrift support, I came across this:
    http://code.google.com/p/thrift-go/

    Not sure if this is maintained, or just something that someone threw out
    there once, since it only has 2 commits.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Justin Israel at May 11, 2013 at 9:45 am
    Thanks for the info everyone! This is actually an attempt to use calls to
    an existing Java server with a thrift interface.
    I just tried https://github.com/apesternikov/thrift4go
    It seemed to generate bindings that don't work too well.

    1) It uses an import statement
    "github.com/apesternikov/thrift4go/lib/go/src/thrift" even though the merge
    install process creates it as "thrift", so I had to symlink the pkg
    2) It didn't really like the fact that the project uses two different
    thrift files, with one importing the other. It created duplicate
    declarations for some stuff in the main file, and the other "common" thrift
    file had unused imports.
    After I hand edited the main generated file to just paste in the lines from
    the other "common" generated file and removed the import for it, it was
    complaining a bunch about the fact that it uses a "type Guid string", and
    uses that Guid type as a string argument:

         RpcService.go:10337: cannot use p.Id (type Guid) as type string in
    function argument

    Ideally I would just be able to generate the bindings the same way as the
    other project does for Java and python, and just have immediately
    functional bindings. Seems like what is being generated needs some hand
    editing so far :-(

    On Friday, May 10, 2013 3:40:32 PM UTC+12, Justin Israel wrote:

    Can anyone confirm whether Thrift support for Go is officially up to date?
    I was trying to get started with a new project, and was just testing out
    the thrift generator and it seemed to produce code that isn't valid for Go
    1.x? Mainly a lot of "err is shadowed during return" until it just failed.

    I saw go-thrift, which comes with it's own generator, but it seems like
    you have to write your spec file in Go as opposed to the thrift spec? It
    didn't seems to want to parse my existing thrift spec file without a syntax
    error.

    Then after search for Go 1.1 thrift support, I came across this:
    http://code.google.com/p/thrift-go/

    Not sure if this is maintained, or just something that someone threw out
    there once, since it only has 2 commits.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Justin Israel at Jul 11, 2013 at 11:06 pm
    Sorry to revive an older thread, but I am revisiting this problem again to
    try and see if I really can get Go thrift client bindings to work, for a
    few of our existing services. Can anyone offer some insight as to this type
    of error?

    The thrift spec defines a type:
         typedef string Id

    which generates the equivalent in the Go ttypes:
         type Id string

    but produces a ton of errors in all of the function calls that expect a
    string, but are passed an Id type:
         cannot use p.Id (type Id) as type string in function argument


    On Saturday, May 11, 2013 9:45:45 PM UTC+12, Justin Israel wrote:

    Thanks for the info everyone! This is actually an attempt to use calls to
    an existing Java server with a thrift interface.
    I just tried https://github.com/apesternikov/thrift4go
    It seemed to generate bindings that don't work too well.

    1) It uses an import statement "
    github.com/apesternikov/thrift4go/lib/go/src/thrift" even though the
    merge install process creates it as "thrift", so I had to symlink the pkg
    2) It didn't really like the fact that the project uses two different
    thrift files, with one importing the other. It created duplicate
    declarations for some stuff in the main file, and the other "common" thrift
    file had unused imports.
    After I hand edited the main generated file to just paste in the lines
    from the other "common" generated file and removed the import for it, it
    was complaining a bunch about the fact that it uses a "type Guid string",
    and uses that Guid type as a string argument:

    RpcService.go:10337: cannot use p.Id (type Guid) as type string in
    function argument

    Ideally I would just be able to generate the bindings the same way as the
    other project does for Java and python, and just have immediately
    functional bindings. Seems like what is being generated needs some hand
    editing so far :-(

    On Friday, May 10, 2013 3:40:32 PM UTC+12, Justin Israel wrote:

    Can anyone confirm whether Thrift support for Go is officially up to date?
    I was trying to get started with a new project, and was just testing out
    the thrift generator and it seemed to produce code that isn't valid for Go
    1.x? Mainly a lot of "err is shadowed during return" until it just failed.

    I saw go-thrift, which comes with it's own generator, but it seems like
    you have to write your spec file in Go as opposed to the thrift spec? It
    didn't seems to want to parse my existing thrift spec file without a syntax
    error.

    Then after search for Go 1.1 thrift support, I came across this:
    http://code.google.com/p/thrift-go/

    Not sure if this is maintained, or just something that someone threw out
    there once, since it only has 2 commits.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Notmikegibson at Jul 12, 2013 at 5:29 pm
    I'm not familiar with that error, but just wanted to say that the official thrift Go support has been recently patched (pulling in pomacks work and some others). I'm using the dev version of thrift from git with Go1.1.1 and not having any issues.

    See https://issues.apache.org/jira/browse/THRIFT-2012

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Justin Israel at Jul 14, 2013 at 2:52 am
    Did you have to update any existing service implementations in your code? I
    grabbed the git repo and built thrift-1.0.0dev. It generated Go bindings
    for my project fine and compiled them file as well. But when building the
    existing project (from thrift 0.9.0) again, its complaining about the
    thrift service implementations as if stuff has changed to break 0.9.0

    On Saturday, July 13, 2013 5:29:47 AM UTC+12, notmik...@gmail.com wrote:

    I'm not familiar with that error, but just wanted to say that the official
    thrift Go support has been recently patched (pulling in pomacks work and
    some others). I'm using the dev version of thrift from git with Go1.1.1 and
    not having any issues.

    See https://issues.apache.org/jira/browse/THRIFT-2012
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Justin Israel at Jul 14, 2013 at 3:50 am
    I managed to get something working, but only by keeping my existing
    projects code using thrift 0.9.0 generated bindings so that they would
    compile, and then used the thrift 1.0.0 generator to specifically generate
    the Go bindings.

    On Sunday, July 14, 2013 2:52:43 PM UTC+12, Justin Israel wrote:

    Did you have to update any existing service implementations in your code?
    I grabbed the git repo and built thrift-1.0.0dev. It generated Go bindings
    for my project fine and compiled them file as well. But when building the
    existing project (from thrift 0.9.0) again, its complaining about the
    thrift service implementations as if stuff has changed to break 0.9.0

    On Saturday, July 13, 2013 5:29:47 AM UTC+12, notmik...@gmail.com wrote:

    I'm not familiar with that error, but just wanted to say that the
    official thrift Go support has been recently patched (pulling in pomacks
    work and some others). I'm using the dev version of thrift from git with
    Go1.1.1 and not having any issues.

    See https://issues.apache.org/jira/browse/THRIFT-2012
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMay 10, '13 at 3:40a
activeJul 14, '13 at 3:50a
posts10
users5
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase