[go-nuts] How to pass value in nested template if possible?

2017-03-14 Thread Simon Ritchie
You are right, the documentation for templates is very scanty.  You will find 
all sorts of useful examples in my scaffolder project 
https://github.com/goblimey/scaffolder.

This doesn't answer your main question, but I see that somebody else has done 
that.

Simon

-- 
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.


[go-nuts] How to pass value in nested template if possible?

2017-03-13 Thread Ilya Kostarev

How to pass value in nested template if possible?
Template package has terse documentation and not much examples.
In brief I want to
if err := template.Must(template.New("").Parse(`{{ define "inner" 
}}{{ . }}{{end}}{{ define "outer" }}{{ template 
"inner"}}{{end}}`)).ExecuteTemplate(os.Stdout, "outer", "foo"); err != nil {

print(err)
}
which write

instead of desired "foo". Error isn't spawned. Am I missing something?
Cheers.
__
Ilya

--
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.