* Add new function to Render interface for writing content type only * Add support for the new function in Render interface for writing content-type only * Fix unhandled merge conflict in context_test.go * Update vendor.json
This commit is contained in:
committed by
GitHub
parent
75c2274b4b
commit
963acc4b0c
+6
-1
@@ -58,9 +58,14 @@ func (r HTMLDebug) loadTemplate() *template.Template {
|
||||
}
|
||||
|
||||
func (r HTML) Render(w http.ResponseWriter) error {
|
||||
writeContentType(w, htmlContentType)
|
||||
r.WriteContentType(w)
|
||||
|
||||
if len(r.Name) == 0 {
|
||||
return r.Template.Execute(w, r.Data)
|
||||
}
|
||||
return r.Template.ExecuteTemplate(w, r.Name, r.Data)
|
||||
}
|
||||
|
||||
func (r HTML) WriteContentType(w http.ResponseWriter) {
|
||||
writeContentType(w, htmlContentType)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user