text/template


The New call gets a string that becomes the name of this template. I am not sure where is that name used again.

examples/text-template/text_template.go
package main

import (
    "os"
    "text/template"
)

func main() {
    tmpl, err := template.New("test").Parse("Hello World!\n")
    if err != nil {
        panic(err)
    }
    err = tmpl.Execute(os.Stdout, nil)
    if err != nil {
        panic(err)
    }
}