* 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:
Javier Provecho Fernandez
2017-01-09 16:24:48 +01:00
committed by GitHub
parent 75c2274b4b
commit 963acc4b0c
12 changed files with 213 additions and 34 deletions
+5 -1
View File
@@ -16,6 +16,10 @@ type XML struct {
var xmlContentType = []string{"application/xml; charset=utf-8"}
func (r XML) Render(w http.ResponseWriter) error {
writeContentType(w, xmlContentType)
r.WriteContentType(w)
return xml.NewEncoder(w).Encode(r.Data)
}
func (r XML) WriteContentType(w http.ResponseWriter) {
writeContentType(w, xmlContentType)
}