Actually, the issue is not the template but my logger. The logger is writing to os.Stderr for some reason that's not preserving new lines but if i do fmt.Println then the new lines are preserved. Pretty sure i've made a simple error here and need to investigate more.
Joe On Saturday, September 17, 2016 at 7:44:55 AM UTC-5, Joseph Lorenzini wrote: > > Hi all, > > Say I have the following struct: > > type Info struct { > Summary string > Desc string > } > > And this is the template string > > tmplStr = `Summary={{.Summary}}, Desc={{.Desc}}` > > If the value of Desc has newlines, it looks like the template engine > strips those out and replaces them with spaces. Is there any way to force > the template engine to preserve the new lines? > > Thanks, > Joe > > -- 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.