fix golint issues in rest (#529)

This commit is contained in:
Kevin Wan
2021-03-01 19:15:35 +08:00
committed by GitHub
parent d894b88c3e
commit 655ae8034c
29 changed files with 132 additions and 32 deletions

View File

@@ -17,8 +17,10 @@ const (
)
var (
// ErrInvalidMethod is an error that indicates not a valid http method.
ErrInvalidMethod = errors.New("not a valid http method")
ErrInvalidPath = errors.New("path must begin with '/'")
// ErrInvalidPath is an error that indicates path is not start with /.
ErrInvalidPath = errors.New("path must begin with '/'")
)
type patRouter struct {
@@ -27,6 +29,7 @@ type patRouter struct {
notAllowed http.Handler
}
// NewRouter returns a httpx.Router.
func NewRouter() httpx.Router {
return &patRouter{
trees: make(map[string]*search.Tree),