Skip to content

Commit

Permalink
docs(routergroup.go): improve documentation
Browse files Browse the repository at this point in the history
Signed-off-by: bestgopher <84328409@qq.com>
  • Loading branch information
bestgopher committed Sep 13, 2023
1 parent d4022e3 commit d592e50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions routergroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ func (group *RouterGroup) handle(httpMethod, relativePath string, handlers Handl
// The last handler should be the real handler, the other ones should be middleware that can and should be shared among different routes.
// See the example code in GitHub.
//
// For GET, POST, PUT, PATCH and DELETE requests the respective shortcut
// For GET, POST, PUT, PATCH, DELETE, OPTIONS and HEAD requests the respective shortcut
// functions can be used.
//
// This function is intended for bulk loading and to allow the usage of less
// frequently used, non-standardized or custom methods (e.g. for internal
// communication with a proxy).
func (group *RouterGroup) Handle(httpMethod, relativePath string, handlers ...HandlerFunc) IRoutes {
if matched := regEnLetter.MatchString(httpMethod); !matched {
panic("http method " + httpMethod + " is not valid")
panic("http method " + httpMethod + " is invalid")
}
return group.handle(httpMethod, relativePath, handlers)
}
Expand Down

0 comments on commit d592e50

Please sign in to comment.