It's easy to execute template ('tmplhtml' in my case) in 'go' to os.Stdout but how to write it to a string 'output' so I can later i.e. send html in mail using "gopkg.in/gomail.v2"
?
var output string
t := template.Must(template.New("html table").Parse(tmplhtml))
err = t.Execute(output, Files)
m.SetBody("text/html", output) //"gopkg.in/gomail.v2"
Build error reads 'cannot use output (type string) as type io.Writer in argument to t.Execute: string does not implement io.Writer (missing Write method)' I can implement Writer method but it is supposed to return integer Write(p []byte) (n int, err error)