FAQ
I just came across the %#v format string, which outputs a value as its own declaration, ie, valid Go code. Handy for codegen: http://clipperhouse.com/2015/01/31/embedding-a-struct-declaration-in-a-text-template-in-go/

I found it neat, perhaps you will too. Metaprogramming via printf.

--
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/d/optout.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedFeb 1, '15 at 7:08p
activeFeb 1, '15 at 7:08p
posts1
users1
websitegolang.org

1 user in discussion

Matt Sherman: 1 post

People

Translate

site design / logo © 2021 Grokbase