Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: julienschmidt/httprouter
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d31a9b1b127f23854ed4ce9766e316b3c78f7e64
Choose a base ref
..
head repository: julienschmidt/httprouter
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c4d72b303d09bac383426fd0c95baa86345348d4
Choose a head ref
Showing with 2 additions and 2 deletions.
  1. +1 −1 router.go
  2. +1 −1 router_test.go
2 changes: 1 addition & 1 deletion router.go
Original file line number Diff line number Diff line change
@@ -300,7 +300,7 @@ func (r *Router) LookupRoute(method, path string) (handler Handle, handledPath s
// the same path with an extra / without the trailing slash should be performed.
func (r *Router) Lookup(method, path string) (Handle, Params, bool) {
if root := r.trees[method]; root != nil {
h, _, p, trs := root.getValue(path)
h, _, p, tsr := root.getValue(path)
return h, p, tsr
}
return nil, nil, false
2 changes: 1 addition & 1 deletion router_test.go
Original file line number Diff line number Diff line change
@@ -491,7 +491,7 @@ func TestRouterLookup(t *testing.T) {
t.Error("Got no TSR recommendation!")
}

handle, _, _, tsr = router.Lookup("GET", "/nope")
handle, _, tsr = router.Lookup("GET", "/nope")
if handle != nil {
t.Fatalf("Got handle for unregistered pattern: %v", handle)
}