Standard library / html/template
html/template.New()
Creates a named, initially undefined template. Expected stdout: 'greet\n'.
Formal Syntax & Structure
go syntaxgo
func New(name string) *TemplateParameters & Attributes
| Name | Type | Description |
|---|---|---|
| name | string | Name of the template. |
Return Value
*Template
Creates a named, initially undefined template.
Working Example
Example Snippetgo
package main
import ( "fmt" "html/template")
func main() { t := template.New("greet"); fmt.Println(t.Name()) }