Commit 1a8f7533 authored by Matthew Holt's avatar Matthew Holt

Meh.

parent 23f7f5eb
...@@ -181,12 +181,12 @@ func (b Browse) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) { ...@@ -181,12 +181,12 @@ func (b Browse) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) {
Items: fileinfos, Items: fileinfos,
} }
// TODO: Use pooled buffers to reduce allocations
var buf bytes.Buffer var buf bytes.Buffer
err = bc.Template.Execute(&buf, listing) err = bc.Template.Execute(&buf, listing)
if err != nil { if err != nil {
return http.StatusInternalServerError, err return http.StatusInternalServerError, err
} }
w.Header().Set("Content-Type", "text/html; charset=utf-8") w.Header().Set("Content-Type", "text/html; charset=utf-8")
buf.WriteTo(w) buf.WriteTo(w)
......
...@@ -48,7 +48,6 @@ func (t Templates) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error ...@@ -48,7 +48,6 @@ func (t Templates) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error
} }
// Execute it // Execute it
// TODO: Use pooled buffers to reduce allocations
var buf bytes.Buffer var buf bytes.Buffer
err = bc.Template.Execute(&buf, ctx) err = bc.Template.Execute(&buf, ctx)
if err != nil { if err != nil {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment