find returns the route with the given path and returns nil if none was found.
(path string)
| 5 | |
| 6 | // find returns the route with the given path and returns nil if none was found. |
| 7 | func (rt Routes) find(path string) *Route { |
| 8 | for _, r := range rt { |
| 9 | if r.Path == path { |
| 10 | return r |
| 11 | } |
| 12 | } |
| 13 | return nil |
| 14 | } |
| 15 | |
| 16 | // sort by path in reverse order (most to least specific) |
| 17 | func (rt Routes) Len() int { return len(rt) } |
no outgoing calls
no test coverage detected