Ross Light avatar Ross Light committed 13c3df9

Fix compiler errors

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),
 	})
 }
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.