Details

    • Type: Wish Wish
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.7
    • Component/s: None
    • Labels:
      None

      Description

      Add code generation for 'Go' http://golang.org/

      1. gopatch.diff
        520 kB
        Aalok Shah
      2. go-language-support-4thrift.diff
        16 kB
        Anatol Pomozov

        Activity

        Hide
        Anatol Pomozov added a comment -

        Hi everyone.

        Just want t let you know that I have a basic Thrift generator for Go language. It can generate structures. It does not generate services yet.

        Patch changes, build and run using following command.

        $ ./compiler/cpp/thrift --gen go test/SmallTest.thrift
        $ less gen-go/SmallTest.go

        Unfortunately I don't have time for development now so I am looking for someone who could continue working on this stuff.

        Best of all if you grub changes from github http://github.com/anatol/thrift/tree/go

        Show
        Anatol Pomozov added a comment - Hi everyone. Just want t let you know that I have a basic Thrift generator for Go language. It can generate structures. It does not generate services yet. Patch changes, build and run using following command. $ ./compiler/cpp/thrift --gen go test/SmallTest.thrift $ less gen-go/SmallTest.go Unfortunately I don't have time for development now so I am looking for someone who could continue working on this stuff. Best of all if you grub changes from github http://github.com/anatol/thrift/tree/go
        Hide
        Aalok Shah added a comment -

        I've uploaded a code review for adding Go support to Thrift at http://codereview.appspot.com/4168058/
        The source code and a README are available at https://github.com/pomack/thrift4go
        Tutorial included

        I haven't submitted anything to ASF before, so please let me know if there's something I should do

        As stated in the README
        generates code for the following protocols:
        1) Binary Protocol (with test cases)
        2) Fast Binary Protocol (with test cases)
        3) Standard Thrift JSON Protocol (with test cases)
        4) A (custom) simple JSON Protocol (with test cases)
        5) Services (compiles and runs against Java, assumed to work elsewhere)

        Tested on Mac OS X 10.6 (Snow Leopard)

        To install in your Go Repository do:
        goinstall github.com/pomack/thrift4go/lib/go/thrift
        goinstall -a -log

        4 files for thrift compiler (last tested on February 17, 2010):
        1) configure.ac
        2) lib/Makefile.am
        3) compiler/cpp/Makefile.am
        4) compiler/cpp/src/generate/t_go_generator.cc

        Show
        Aalok Shah added a comment - I've uploaded a code review for adding Go support to Thrift at http://codereview.appspot.com/4168058/ The source code and a README are available at https://github.com/pomack/thrift4go Tutorial included I haven't submitted anything to ASF before, so please let me know if there's something I should do As stated in the README generates code for the following protocols: 1) Binary Protocol (with test cases) 2) Fast Binary Protocol (with test cases) 3) Standard Thrift JSON Protocol (with test cases) 4) A (custom) simple JSON Protocol (with test cases) 5) Services (compiles and runs against Java, assumed to work elsewhere) Tested on Mac OS X 10.6 (Snow Leopard) To install in your Go Repository do: goinstall github.com/pomack/thrift4go/lib/go/thrift goinstall -a -log 4 files for thrift compiler (last tested on February 17, 2010): 1) configure.ac 2) lib/Makefile.am 3) compiler/cpp/Makefile.am 4) compiler/cpp/src/generate/t_go_generator.cc
        Hide
        Christian Lavoie added a comment -

        Hey Aalok – you need to upload an SVN patch to JIRA (it's simpler for us to patch in the code from tools we're use to, but it also gets you to record that you're allowing the ASF to license the code under its usual license, which is required to contribute the code).

        I've tested the code (btw, there's a bug in your patch in the t_go_generator.cc file; see http://codereview.appspot.com/4168058/patch/1/5 ; but I used the one off your github repository to test things).

        Generally speaking looks okay – but the integration with the make system is a bit off. In particular, I tried 'make check' in lib/go and got:

        make: *** No rule to make target `check'. Stop.

        Regardless, it needs to be uploaded here as a patch to be commitable. The simplest way to do that is using svn diff to generate a file, and attach it to THRIFT-625.

        Show
        Christian Lavoie added a comment - Hey Aalok – you need to upload an SVN patch to JIRA (it's simpler for us to patch in the code from tools we're use to, but it also gets you to record that you're allowing the ASF to license the code under its usual license, which is required to contribute the code). I've tested the code (btw, there's a bug in your patch in the t_go_generator.cc file; see http://codereview.appspot.com/4168058/patch/1/5 ; but I used the one off your github repository to test things). Generally speaking looks okay – but the integration with the make system is a bit off. In particular, I tried 'make check' in lib/go and got: make: *** No rule to make target `check'. Stop. Regardless, it needs to be uploaded here as a patch to be commitable. The simplest way to do that is using svn diff to generate a file, and attach it to THRIFT-625 .
        Hide
        Aalok Shah added a comment -

        Here is the patch file as requested by Christian Lavoie.
        I've added in make check target
        I've also modified the deps.bash to include changes in the Go library.

        The deps.bash and Makefiles were originally from the Go Library and says it is governed by a BSD-style license. I've kept the copyright statement intact.

        All other files were either already part of Thrift or created by me.

        Show
        Aalok Shah added a comment - Here is the patch file as requested by Christian Lavoie. I've added in make check target I've also modified the deps.bash to include changes in the Go library. The deps.bash and Makefiles were originally from the Go Library and says it is governed by a BSD-style license. I've kept the copyright statement intact. All other files were either already part of Thrift or created by me.
        Hide
        Christian Lavoie added a comment -

        Committed. Thanks!

        Show
        Christian Lavoie added a comment - Committed. Thanks!
        Hide
        Christian Lavoie added a comment -

        Committed revision 1072478.

        Show
        Christian Lavoie added a comment - Committed revision 1072478.

          People

          • Assignee:
            Christian Lavoie
            Reporter:
            Mathias Herberts
          • Votes:
            3 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development