草庐IT

angularjs - Golang html/模板 : ParseFiles with custom Delims

在使用template.New("...").Delims("[[","]]").Parse()时,使用带分隔符的模板效果很好但是,我无法弄清楚如何使用template.ParseFiles()获得相同的结果tmpl,err:=template.ParseFiles("base.tmpl","homepage/inner.tmpl")iferr!=nil{panic(err)}tmpl.Delims("[[","]]")p:=new(Page)err=tmpl.Execute(os.Stdout,p)iferr!=nil{panic(err)}我没有错误,但分隔符没有改变。tmpl,e
12