You can use go/format.Source. V.
On Monday, 26 March 2018 19:29:15 UTC+2, Darko Luketic wrote: > > How would I use something like gofmt to format a string in memory? > > I wouldn't want to write a temporary file then os.Exec gofmt and re-read > that file. > There has to be a better way. Did anyone do anything like that before? > -- 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.