Hello, i had similar issue with empty block inserts in Go 1.8, after changing {{block "name" .}}{{end}} to {{template "name"}} template starts working. may be it is affected by commit https://github.com/golang/go/commit/2b583a190eb14c69bffe5d488d2d6d3862fe76ea in file src/text/template/template.go, with previous version of template.go it works with {{block "name" .}}{{end}}.
Hello, > > I am using Go templates to generated the files inside an EPUB container. > Since I switched to Go version 1.8 the output of my rendered templates > seems to be no longer deterministic and often bit which used to be always > there are now missing. > > Minimal working (well, broken) example: > https://play.golang.org/p/BnwKHNrnom > Full, messy code: https://github.com/seehuhn/epublatex > > When I run the code from the "minimal working example", on my machine the > output differs between runs: > > voss@flammeri [..uhn/epublatex] go run bug.go > <!DOCTYPE html> > <html xmlns="http://www.w3.org/1999/xhtml"> > <head> > <meta charset="utf-8"/> > </head> > <body> > </body> > </html> > voss@flammeri [..uhn/epublatex] go run bug.go > <!DOCTYPE html> > <html xmlns="http://www.w3.org/1999/xhtml"> > <head> > <title></title> > <meta charset="utf-8"/> > <link rel="stylesheet" type="text/css" href=""/> > </head> > <body id="titlepage" > > </body> > </html> > > The second run has the stylesheet line included, while it is missing in > the first run. On play.golang.org the code seems deterministic, but I > suspect that may be due to caching? > > Am I misusing Go templates here? If so, what should I be doing > differently? Or is there a problem with templates in Go version 1.8? > > Many thanks, > Jochen > > -- 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.