Commits

Ross Light committed 13c3df9

Fix compiler errors

  • Participants
  • Parent commits 4c05669

Comments (0)

Files changed (2)

 
 import (
 	"bytes"
-	"encoding/json"
 	"io"
 	"log"
 	"net/http"
 
 // ResponseStats is a ResponseWriter that records statistics about a response.
 type ResponseStats struct {
-	w          http.ResponseWriter
-	statusCode int
-	size       int64
+	w    http.ResponseWriter
+	code int
+	size int64
 }
 
 // NewResponseStats returns a new ResponseStats that writes to w.
 
 func (r *ResponseStats) WriteHeader(statusCode int) {
 	r.w.WriteHeader(statusCode)
-	r.statusCode = statusCode
+	r.code = statusCode
 }
 
 func (r *ResponseStats) Write(p []byte) (n int, err error) {
-	if r.statusCode == 0 {
-		r.statusCode = http.StatusOK
+	if r.code == 0 {
+		r.code = http.StatusOK
 	}
 	n, err = r.w.Write(p)
 	r.size += int64(n)
 // AddFuncs adds the package's template functions.
 func AddFuncs(t *template.Template, router *mux.Router) {
 	t.Funcs(template.FuncMap{
-		"path": routePath(router),
-		"url":  routeURL(router),
+		"path": RoutePath(router),
+		"url":  RouteURL(router),
 	})
 }