Files
the-way-to-go_ZH_CN/eBook/examples/chapter_15/predefined_functions.go
2013-05-07 23:43:09 -04:00

14 lines
252 B
Go

// predefined_functions.go
package main
import (
"os"
"text/template"
)
func main() {
t := template.New("test")
t = template.Must(t.Parse("{{with $x := `hello`}}{{printf `%s %s` $x `Mary`}}{{end}}!\n"))
t.Execute(os.Stdout, nil)
}
// hello Mary!