FAQ
Hi,

I was wondering if there are any good examples of generating go code
as a pre-build step. I'd like to read some DB schema metadata and
generate boilerplate accessor go code.

I'm assuming there is some capability to do code generation or
formatting in the standard library, so I presume gofmt must have to
generate go files, but I can't to find any straight forward examples
of how to generate code go based on some meta model. Is this something
you'd need to cobble together?

Also, are there any standardized ways of binding a code generation
phase into the standard go build/run cycle?

Cheers,

Ben

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

  • Tamás Gulácsi at Nov 24, 2013 at 3:57 pm
    See go/format and go/ast. For stored procedure accessor generating, now I use simple printf and after some format.Source.

    --
    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.
  • Ben Hood at Nov 24, 2013 at 7:51 pm
    Thanks for the heads up - I'll check this out.
    On Nov 24, 2013, at 15:57, Tamás Gulácsi wrote:

    See go/format and go/ast. For stored procedure accessor generating, now I use simple printf and after some format.Source.

    --
    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.
    --
    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
postedNov 24, '13 at 3:16p
activeNov 24, '13 at 7:51p
posts3
users2
websitegolang.org

2 users in discussion

Ben Hood: 2 posts Tamás Gulácsi: 1 post

People

Translate

site design / logo © 2021 Grokbase