{"repo":"gin","file":"Makefile","line":1,"symbol":"GO","kind":"variable","lang":"make","code":"GO ?= go"} {"repo":"gin","file":"Makefile","line":2,"symbol":"GOFMT","kind":"variable","lang":"make","code":"GOFMT ?= gofmt \"-s\""} {"repo":"gin","file":"Makefile","line":3,"symbol":"GO_VERSION","kind":"variable","lang":"make","code":"GO_VERSION=$(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)"} {"repo":"gin","file":"Makefile","line":4,"symbol":"PACKAGES","kind":"variable","lang":"make","code":"PACKAGES ?= $(shell $(GO) list ./...)"} {"repo":"gin","file":"Makefile","line":5,"symbol":"VETPACKAGES","kind":"variable","lang":"make","code":"VETPACKAGES ?= $(shell $(GO) list ./... | grep -v /examples/)"} {"repo":"gin","file":"Makefile","line":6,"symbol":"GOFILES","kind":"variable","lang":"make","code":"GOFILES := $(shell find . -name \"*.go\")"} {"repo":"gin","file":"Makefile","line":7,"symbol":"TESTFOLDER","kind":"variable","lang":"make","code":"TESTFOLDER := $(shell $(GO) list ./... | grep -E 'gin$$|ginS$$|binding$$|render$$' | grep -v examples)"} {"repo":"gin","file":"Makefile","line":8,"symbol":"TESTTAGS","kind":"variable","lang":"make","code":"TESTTAGS ?= \"\""} {"repo":"gin","file":"Makefile","line":10,"symbol":".PHONY","kind":"target","lang":"make","code":".PHONY: test"} {"repo":"gin","file":"Makefile","line":12,"symbol":"test","kind":"target","lang":"make","code":"test:\n\techo \"mode: count\" > coverage.out\n\tfor d in $(TESTFOLDER); do \\\n\t\tif [ -n \"$(TESTTAGS)\" ]; then \\\n\t\t\t$(GO) test $(TESTTAGS) -v -covermode=count -coverprofile=profile.out $$d > tmp.out; \\\n\t\telse \\\n\t\t\t$(GO) test -v -covermode=count -coverprofile=profile.out $$d > tmp.out; \\\n\t\tfi; \\\n\t\tcat tmp.out; \\\n\t\tif grep -q \"^--- FAIL\" tmp.out; then \\\n\t\t\trm tmp.out; \\\n\t\t\texit 1; \\\n\t\telif grep -q \"build failed\" tmp.out; then \\\n\t\t\trm tmp.out; \\\n\t\t\texit 1; \\\n\t\telif grep -q \"setup failed\" tmp.out; then \\\n\t\t\trm tmp.out; \\\n\t\t\texit 1; \\\n\t\tfi; \\\n\t\tif [ -f profile.out ]; then \\\n\t\t\tcat profile.out | grep -v \"mode:\" >> coverage.out; \\\n\t\t\trm profile.out; \\\n\t\tfi; \\\n\tdone"} {"repo":"gin","file":"Makefile","line":37,"symbol":".PHONY","kind":"target","lang":"make","code":".PHONY: fmt"} {"repo":"gin","file":"Makefile","line":39,"symbol":"fmt","kind":"target","lang":"make","code":"fmt:\n\t$(GOFMT) -w $(GOFILES)"} {"repo":"gin","file":"Makefile","line":42,"symbol":".PHONY","kind":"target","lang":"make","code":".PHONY: fmt-check"} {"repo":"gin","file":"Makefile","line":44,"symbol":"fmt-check","kind":"target","lang":"make","code":"fmt-check:\n\t@diff=$$($(GOFMT) -d $(GOFILES)); \\\n\tif [ -n \"$$diff\" ]; then \\\n\t\techo \"Please run 'make fmt' and commit the result:\"; \\\n\t\techo \"$${diff}\"; \\\n\t\texit 1; \\\n\tfi;"} {"repo":"gin","file":"Makefile","line":52,"symbol":".PHONY","kind":"target","lang":"make","code":".PHONY: vet"} {"repo":"gin","file":"Makefile","line":54,"symbol":"vet","kind":"target","lang":"make","code":"vet:\n\t$(GO) vet $(VETPACKAGES)"} {"repo":"gin","file":"Makefile","line":57,"symbol":".PHONY","kind":"target","lang":"make","code":".PHONY: lint"} {"repo":"gin","file":"Makefile","line":59,"symbol":"lint","kind":"target","lang":"make","code":"lint:\n\t@hash golint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \\\n\t\t$(GO) get -u golang.org/x/lint/golint; \\\n\tfi\n\tfor PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done;"} {"repo":"gin","file":"Makefile","line":65,"symbol":".PHONY","kind":"target","lang":"make","code":".PHONY: misspell"} {"repo":"gin","file":"Makefile","line":67,"symbol":"misspell","kind":"target","lang":"make","code":"misspell:\n\t@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \\\n\t\t$(GO) get -u github.com/client9/misspell/cmd/misspell; \\\n\tfi\n\tmisspell -w $(GOFILES)"} {"repo":"gin","file":"Makefile","line":73,"symbol":".PHONY","kind":"target","lang":"make","code":".PHONY: misspell-check"} {"repo":"gin","file":"Makefile","line":75,"symbol":"misspell-check","kind":"target","lang":"make","code":"misspell-check:\n\t@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \\\n\t\t$(GO) get -u github.com/client9/misspell/cmd/misspell; \\\n\tfi\n\tmisspell -error $(GOFILES)"} {"repo":"gin","file":"Makefile","line":81,"symbol":".PHONY","kind":"target","lang":"make","code":".PHONY: tools"} {"repo":"gin","file":"Makefile","line":83,"symbol":"tools","kind":"target","lang":"make","code":"tools:\n\t@if [ $(GO_VERSION) -gt 15 ]; then \\\n\t\t$(GO) install golang.org/x/lint/golint@latest; \\\n\t\t$(GO) install github.com/client9/misspell/cmd/misspell@latest; \\\n\telif [ $(GO_VERSION) -lt 16 ]; then \\\n\t\t$(GO) install golang.org/x/lint/golint; \\\n\t\t$(GO) install github.com/client9/misspell/cmd/misspell; \\\n\tfi"} {"repo":"gin","file":"Makefile","line":92,"symbol":".PHONY","kind":"target","lang":"make","code":".PHONY: help"} {"repo":"gin","file":"Makefile","line":94,"symbol":"help","kind":"target","lang":"make","code":"help:\n\t@echo ''\n\t@echo 'Usage:'\n\t@echo ' make [target]'\n\t@echo ''\n\t@echo 'Targets:'\n\t@awk '/^[a-zA-Z\\-\\0-9]+:/ { \\\n\thelpMessage = match(lastLine, /^# (.*)/); \\\n\t\tif (helpMessage) { \\\n\t\t\thelpCommand = substr($$1, 0, index($$1, \":\")-1); \\\n\t\t\thelpMessage = substr(lastLine, RSTART + 2, RLENGTH); \\\n\t\t\tprintf \" - \\033[36m%-20s\\033[0m %s\\n\", helpCommand, helpMessage; \\\n\t\t} \\\n\t} \\\n\t{ lastLine = $$0 }' $(MAKEFILE_LIST)"} {"repo":"gin","file":"Makefile","line":110,"symbol":".DEFAULT_GOAL","kind":"variable","lang":"make","code":".DEFAULT_GOAL := help"} {"repo":"gin","file":"auth.go","line":17,"symbol":"AuthUserKey","kind":"constant","lang":"go","doc":"AuthUserKey is the cookie name for user credential in basic auth.","code":"AuthUserKey = \"user\""} {"repo":"gin","file":"auth.go","line":20,"symbol":"AuthProxyUserKey","kind":"constant","lang":"go","doc":"AuthProxyUserKey is the cookie name for proxy_user credential in basic auth for proxy.","code":"AuthProxyUserKey = \"proxy_user\""} {"repo":"gin","file":"auth.go","line":23,"symbol":"Accounts","kind":"type","lang":"go","doc":"Accounts defines a key/value for user/pass list of authorized logins.","code":"type Accounts map[string]string"} {"repo":"gin","file":"auth.go","line":25,"symbol":"authPair","kind":"type","lang":"go","code":"type authPair struct {\n\tvalue string\n\tuser string\n}"} {"repo":"gin","file":"auth.go","line":30,"symbol":"authPairs","kind":"type","lang":"go","code":"type authPairs []authPair"} {"repo":"gin","file":"auth.go","line":32,"symbol":"searchCredential","kind":"method","lang":"go","code":"func (a authPairs) searchCredential(authValue string) (string, bool) {\n\tif authValue == \"\" {\n\t\treturn \"\", false\n\t}\n\tfor _, pair := range a {\n\t\tif subtle.ConstantTimeCompare(bytesconv.StringToBytes(pair.value), bytesconv.StringToBytes(authValue)) == 1 {\n\t\t\treturn pair.user, true\n\t\t}\n\t}\n\treturn \"\", false\n}"} {"repo":"gin","file":"auth.go","line":48,"symbol":"BasicAuthForRealm","kind":"function","lang":"go","doc":"BasicAuthForRealm returns a Basic HTTP Authorization middleware. It takes as arguments a map[string]string where the key is the user name and the value is the password, as well as the name of the Realm. If the realm is empty, \"Authorization Required\" will be used by default. (see http://tools.ietf.org/html/rfc2617#section-1.2)","code":"func BasicAuthForRealm(accounts Accounts, realm string) HandlerFunc {\n\tif realm == \"\" {\n\t\trealm = \"Authorization Required\"\n\t}\n\trealm = \"Basic realm=\" + strconv.Quote(realm)\n\tpairs := processAccounts(accounts)\n\treturn func(c *Context) {\n\t\t// Search user in the slice of allowed credentials\n\t\tuser, found := pairs.searchCredential(c.requestHeader(\"Authorization\"))\n\t\tif !found {\n\t\t\t// Credentials doesn't match, we return 401 and abort handlers chain.\n\t\t\tc.Header(\"WWW-Authenticate\", realm)\n\t\t\tc.AbortWithStatus(http.StatusUnauthorized)\n\t\t\treturn\n\t\t}\n\n\t\t// The user credentials was found, set user's id to key AuthUserKey in this context, the user's id can be read later using\n\t\t// c.MustGet(gin.AuthUserKey).\n\t\tc.Set(AuthUserKey, user)\n\t}\n}"} {"repo":"gin","file":"auth.go","line":72,"symbol":"BasicAuth","kind":"function","lang":"go","doc":"BasicAuth returns a Basic HTTP Authorization middleware. It takes as argument a map[string]string where the key is the user name and the value is the password.","code":"func BasicAuth(accounts Accounts) HandlerFunc {\n\treturn BasicAuthForRealm(accounts, \"\")\n}"} {"repo":"gin","file":"auth.go","line":76,"symbol":"processAccounts","kind":"function","lang":"go","code":"func processAccounts(accounts Accounts) authPairs {\n\tlength := len(accounts)\n\tassert1(length > 0, \"Empty list of authorized credentials\")\n\tpairs := make(authPairs, 0, length)\n\tfor user, password := range accounts {\n\t\tassert1(user != \"\", \"User can not be empty\")\n\t\tvalue := authorizationHeader(user, password)\n\t\tpairs = append(pairs, authPair{\n\t\t\tvalue: value,\n\t\t\tuser: user,\n\t\t})\n\t}\n\treturn pairs\n}"} {"repo":"gin","file":"auth.go","line":91,"symbol":"authorizationHeader","kind":"function","lang":"go","code":"func authorizationHeader(user, password string) string {\n\tbase := user + \":\" + password\n\treturn \"Basic \" + base64.StdEncoding.EncodeToString(bytesconv.StringToBytes(base))\n}"} {"repo":"gin","file":"auth.go","line":98,"symbol":"BasicAuthForProxy","kind":"function","lang":"go","doc":"BasicAuthForProxy returns a Basic HTTP Proxy-Authorization middleware. If the realm is empty, \"Proxy Authorization Required\" will be used by default.","code":"func BasicAuthForProxy(accounts Accounts, realm string) HandlerFunc {\n\tif realm == \"\" {\n\t\trealm = \"Proxy Authorization Required\"\n\t}\n\trealm = \"Basic realm=\" + strconv.Quote(realm)\n\tpairs := processAccounts(accounts)\n\treturn func(c *Context) {\n\t\tproxyUser, found := pairs.searchCredential(c.requestHeader(\"Proxy-Authorization\"))\n\t\tif !found {\n\t\t\t// Credentials doesn't match, we return 407 and abort handlers chain.\n\t\t\tc.Header(\"Proxy-Authenticate\", realm)\n\t\t\tc.AbortWithStatus(http.StatusProxyAuthRequired)\n\t\t\treturn\n\t\t}\n\t\t// The proxy_user credentials was found, set proxy_user's id to key AuthProxyUserKey in this context, the proxy_user's id can be read later using\n\t\t// c.MustGet(gin.AuthProxyUserKey).\n\t\tc.Set(AuthProxyUserKey, proxyUser)\n\t}\n}"} {"repo":"gin","file":"auth_test.go","line":16,"symbol":"TestBasicAuth","kind":"function","lang":"go","code":"func TestBasicAuth(t *testing.T) {\n\tpairs := processAccounts(Accounts{\n\t\t\"admin\": \"password\",\n\t\t\"foo\": \"bar\",\n\t\t\"bar\": \"foo\",\n\t})\n\n\tassert.Len(t, pairs, 3)\n\tassert.Contains(t, pairs, authPair{\n\t\tuser: \"bar\",\n\t\tvalue: \"Basic YmFyOmZvbw==\",\n\t})\n\tassert.Contains(t, pairs, authPair{\n\t\tuser: \"foo\",\n\t\tvalue: \"Basic Zm9vOmJhcg==\",\n\t})\n\tassert.Contains(t, pairs, authPair{\n\t\tuser: \"admin\",\n\t\tvalue: \"Basic YWRtaW46cGFzc3dvcmQ=\",\n\t})\n}"} {"repo":"gin","file":"auth_test.go","line":38,"symbol":"TestBasicAuthFails","kind":"function","lang":"go","code":"func TestBasicAuthFails(t *testing.T) {\n\tassert.Panics(t, func() { processAccounts(nil) })\n\tassert.Panics(t, func() {\n\t\tprocessAccounts(Accounts{\n\t\t\t\"\": \"password\",\n\t\t\t\"foo\": \"bar\",\n\t\t})\n\t})\n}"} {"repo":"gin","file":"auth_test.go","line":48,"symbol":"TestBasicAuthSearchCredential","kind":"function","lang":"go","code":"func TestBasicAuthSearchCredential(t *testing.T) {\n\tpairs := processAccounts(Accounts{\n\t\t\"admin\": \"password\",\n\t\t\"foo\": \"bar\",\n\t\t\"bar\": \"foo\",\n\t})\n\n\tuser, found := pairs.searchCredential(authorizationHeader(\"admin\", \"password\"))\n\tassert.Equal(t, \"admin\", user)\n\tassert.True(t, found)\n\n\tuser, found = pairs.searchCredential(authorizationHeader(\"foo\", \"bar\"))\n\tassert.Equal(t, \"foo\", user)\n\tassert.True(t, found)\n\n\tuser, found = pairs.searchCredential(authorizationHeader(\"bar\", \"foo\"))\n\tassert.Equal(t, \"bar\", user)\n\tassert.True(t, found)\n\n\tuser, found = pairs.searchCredential(authorizationHeader(\"admins\", \"password\"))\n\tassert.Empty(t, user)\n\tassert.False(t, found)\n\n\tuser, found = pairs.searchCredential(authorizationHeader(\"foo\", \"bar \"))\n\tassert.Empty(t, user)\n\tassert.False(t, found)\n\n\tuser, found = pairs.searchCredential(\"\")\n\tassert.Empty(t, user)\n\tassert.False(t, found)\n}"} {"repo":"gin","file":"auth_test.go","line":80,"symbol":"TestBasicAuthAuthorizationHeader","kind":"function","lang":"go","code":"func TestBasicAuthAuthorizationHeader(t *testing.T) {\n\tassert.Equal(t, \"Basic YWRtaW46cGFzc3dvcmQ=\", authorizationHeader(\"admin\", \"password\"))\n}"} {"repo":"gin","file":"auth_test.go","line":84,"symbol":"TestBasicAuthSucceed","kind":"function","lang":"go","code":"func TestBasicAuthSucceed(t *testing.T) {\n\taccounts := Accounts{\"admin\": \"password\"}\n\trouter := New()\n\trouter.Use(BasicAuth(accounts))\n\trouter.GET(\"/login\", func(c *Context) {\n\t\tc.String(http.StatusOK, c.MustGet(AuthUserKey).(string))\n\t})\n\n\tw := httptest.NewRecorder()\n\treq, _ := http.NewRequest(http.MethodGet, \"/login\", nil)\n\treq.Header.Set(\"Authorization\", authorizationHeader(\"admin\", \"password\"))\n\trouter.ServeHTTP(w, req)\n\n\tassert.Equal(t, http.StatusOK, w.Code)\n\tassert.Equal(t, \"admin\", w.Body.String())\n}"} {"repo":"gin","file":"auth_test.go","line":101,"symbol":"TestBasicAuth401","kind":"function","lang":"go","code":"func TestBasicAuth401(t *testing.T) {\n\tcalled := false\n\taccounts := Accounts{\"foo\": \"bar\"}\n\trouter := New()\n\trouter.Use(BasicAuth(accounts))\n\trouter.GET(\"/login\", func(c *Context) {\n\t\tcalled = true\n\t\tc.String(http.StatusOK, c.MustGet(AuthUserKey).(string))\n\t})\n\n\tw := httptest.NewRecorder()\n\treq, _ := http.NewRequest(http.MethodGet, \"/login\", nil)\n\treq.Header.Set(\"Authorization\", \"Basic \"+base64.StdEncoding.EncodeToString([]byte(\"admin:password\")))\n\trouter.ServeHTTP(w, req)\n\n\tassert.False(t, called)\n\tassert.Equal(t, http.StatusUnauthorized, w.Code)\n\tassert.Equal(t, \"Basic realm=\\\"Authorization Required\\\"\", w.Header().Get(\"WWW-Authenticate\"))\n}"} {"repo":"gin","file":"auth_test.go","line":121,"symbol":"TestBasicAuth401WithCustomRealm","kind":"function","lang":"go","code":"func TestBasicAuth401WithCustomRealm(t *testing.T) {\n\tcalled := false\n\taccounts := Accounts{\"foo\": \"bar\"}\n\trouter := New()\n\trouter.Use(BasicAuthForRealm(accounts, \"My Custom \\\"Realm\\\"\"))\n\trouter.GET(\"/login\", func(c *Context) {\n\t\tcalled = true\n\t\tc.String(http.StatusOK, c.MustGet(AuthUserKey).(string))\n\t})\n\n\tw := httptest.NewRecorder()\n\treq, _ := http.NewRequest(http.MethodGet, \"/login\", nil)\n\treq.Header.Set(\"Authorization\", \"Basic \"+base64.StdEncoding.EncodeToString([]byte(\"admin:password\")))\n\trouter.ServeHTTP(w, req)\n\n\tassert.False(t, called)\n\tassert.Equal(t, http.StatusUnauthorized, w.Code)\n\tassert.Equal(t, \"Basic realm=\\\"My Custom \\\\\\\"Realm\\\\\\\"\\\"\", w.Header().Get(\"WWW-Authenticate\"))\n}"} {"repo":"gin","file":"auth_test.go","line":141,"symbol":"TestBasicAuthForProxySucceed","kind":"function","lang":"go","code":"func TestBasicAuthForProxySucceed(t *testing.T) {\n\taccounts := Accounts{\"admin\": \"password\"}\n\trouter := New()\n\trouter.Use(BasicAuthForProxy(accounts, \"\"))\n\trouter.Any(\"/*proxyPath\", func(c *Context) {\n\t\tc.String(http.StatusOK, c.MustGet(AuthProxyUserKey).(string))\n\t})\n\n\tw := httptest.NewRecorder()\n\treq, _ := http.NewRequest(http.MethodGet, \"/test\", nil)\n\treq.Header.Set(\"Proxy-Authorization\", authorizationHeader(\"admin\", \"password\"))\n\trouter.ServeHTTP(w, req)\n\n\tassert.Equal(t, http.StatusOK, w.Code)\n\tassert.Equal(t, \"admin\", w.Body.String())\n}"} {"repo":"gin","file":"auth_test.go","line":158,"symbol":"TestBasicAuthForProxy407","kind":"function","lang":"go","code":"func TestBasicAuthForProxy407(t *testing.T) {\n\tcalled := false\n\taccounts := Accounts{\"foo\": \"bar\"}\n\trouter := New()\n\trouter.Use(BasicAuthForProxy(accounts, \"\"))\n\trouter.Any(\"/*proxyPath\", func(c *Context) {\n\t\tcalled = true\n\t\tc.String(http.StatusOK, c.MustGet(AuthProxyUserKey).(string))\n\t})\n\n\tw := httptest.NewRecorder()\n\treq, _ := http.NewRequest(http.MethodGet, \"/test\", nil)\n\treq.Header.Set(\"Proxy-Authorization\", \"Basic \"+base64.StdEncoding.EncodeToString([]byte(\"admin:password\")))\n\trouter.ServeHTTP(w, req)\n\n\tassert.False(t, called)\n\tassert.Equal(t, http.StatusProxyAuthRequired, w.Code)\n\tassert.Equal(t, \"Basic realm=\\\"Proxy Authorization Required\\\"\", w.Header().Get(\"Proxy-Authenticate\"))\n}"} {"repo":"gin","file":"benchmarks_test.go","line":14,"symbol":"BenchmarkOneRoute","kind":"function","lang":"go","code":"func BenchmarkOneRoute(B *testing.B) {\n\trouter := New()\n\trouter.GET(\"/ping\", func(c *Context) {})\n\trunRequest(B, router, http.MethodGet, \"/ping\")\n}"} {"repo":"gin","file":"benchmarks_test.go","line":20,"symbol":"BenchmarkRecoveryMiddleware","kind":"function","lang":"go","code":"func BenchmarkRecoveryMiddleware(B *testing.B) {\n\trouter := New()\n\trouter.Use(Recovery())\n\trouter.GET(\"/\", func(c *Context) {})\n\trunRequest(B, router, http.MethodGet, \"/\")\n}"} {"repo":"gin","file":"benchmarks_test.go","line":27,"symbol":"BenchmarkLoggerMiddleware","kind":"function","lang":"go","code":"func BenchmarkLoggerMiddleware(B *testing.B) {\n\trouter := New()\n\trouter.Use(LoggerWithWriter(newMockWriter()))\n\trouter.GET(\"/\", func(c *Context) {})\n\trunRequest(B, router, http.MethodGet, \"/\")\n}"} {"repo":"gin","file":"benchmarks_test.go","line":34,"symbol":"BenchmarkManyHandlers","kind":"function","lang":"go","code":"func BenchmarkManyHandlers(B *testing.B) {\n\trouter := New()\n\trouter.Use(Recovery(), LoggerWithWriter(newMockWriter()))\n\trouter.Use(func(c *Context) {})\n\trouter.Use(func(c *Context) {})\n\trouter.GET(\"/ping\", func(c *Context) {})\n\trunRequest(B, router, http.MethodGet, \"/ping\")\n}"} {"repo":"gin","file":"benchmarks_test.go","line":43,"symbol":"Benchmark5Params","kind":"function","lang":"go","code":"func Benchmark5Params(B *testing.B) {\n\tDefaultWriter = os.Stdout\n\trouter := New()\n\trouter.Use(func(c *Context) {})\n\trouter.GET(\"/param/:param1/:params2/:param3/:param4/:param5\", func(c *Context) {})\n\trunRequest(B, router, http.MethodGet, \"/param/path/to/parameter/john/12345\")\n}"} {"repo":"gin","file":"benchmarks_test.go","line":51,"symbol":"BenchmarkOneRouteJSON","kind":"function","lang":"go","code":"func BenchmarkOneRouteJSON(B *testing.B) {\n\trouter := New()\n\tdata := struct {\n\t\tStatus string `json:\"status\"`\n\t}{\"ok\"}\n\trouter.GET(\"/json\", func(c *Context) {\n\t\tc.JSON(http.StatusOK, data)\n\t})\n\trunRequest(B, router, http.MethodGet, \"/json\")\n}"} {"repo":"gin","file":"benchmarks_test.go","line":62,"symbol":"BenchmarkOneRouteHTML","kind":"function","lang":"go","code":"func BenchmarkOneRouteHTML(B *testing.B) {\n\trouter := New()\n\tt := template.Must(template.New(\"index\").Parse(`\n\t\t