fix README.md

This commit is contained in:
delong
2016-07-18 13:28:55 +08:00
parent 9fa818a44c
commit 198f95d824

View File

@@ -118,7 +118,7 @@ Then register routes in the subrouter:
```go ```go
s.HandleFunc("/products/", ProductsHandler) s.HandleFunc("/products/", ProductsHandler)
s.HandleFunc("/products/{key}", ProductHandler) s.HandleFunc("/products/{key}", ProductHandler)
s.HandleFunc("/articles/{category}/{id:[0-9]+}"), ArticleHandler) s.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler)
``` ```
The three URL paths we registered above will only be tested if the domain is `www.example.com`, because the subrouter is tested first. This is not only convenient, but also optimizes request matching. You can create subrouters combining any attribute matchers accepted by a route. The three URL paths we registered above will only be tested if the domain is `www.example.com`, because the subrouter is tested first. This is not only convenient, but also optimizes request matching. You can create subrouters combining any attribute matchers accepted by a route.