Hi.

In a project I need to generate some Go source files containing only 
variable definitions.
These variables are generated by some tools written in Go.

Currently I'm generating the variable definitions using the fmt package 
with the #v flag, but there are several problems:

* The generated literal value does not contain newlines and it is not 
indented.
* map literals have random order, and this is a problem for me since every 
time
   I generate the Go source file, I get a different file or an unnecessary 
large git diff.
* In composite literal, the literal type or &T are not elided when it is 
allowed by Go.
   As an example: https://play.golang.org/p/vxhZNL28nu

In other words, I would like the generated file to look like it was written 
by an human, in order to be easy to read.

I tried to search for an existing package, but without success.
Does such a package exists?


Thanks
Manlio

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to