Home > other >  Bring the go language template t.D elims (" ", "") does not work
Bring the go language template t.D elims (" ", "") does not work

Time:09-27

Tried many times Delims (" & lt; ", "% % & gt;" ) function, set new qualifier is not effective, but the program compiled without any problems, also can run normally, is template doesn't work any change
The go code
 
TMPL, err:=template. ParseFiles (" index. The TPL ")

if err ! Nil={
FMT. Println (" err ")
Panic (err)
}
FMT. Println (TMPL. Name ())
Name:="index"
TMPL. Delims (" & lt; ", "% % & gt;" ). The Execute (w, name)
FMT. Println (" Works ")

HTML template
 



<meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "& gt;
Layout

<body>

The template data: {{...}} & lt;/h3 & gt;


  • Related