Skip to content

Commit

Permalink
use assert1 func (#2783)
Browse files Browse the repository at this point in the history
  • Loading branch information
lancoLiu authored Jul 11, 2021
1 parent 3116a2d commit f96678c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions routergroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,7 @@ func (group *RouterGroup) createStaticHandler(relativePath string, fs http.FileS

func (group *RouterGroup) combineHandlers(handlers HandlersChain) HandlersChain {
finalSize := len(group.Handlers) + len(handlers)
if finalSize >= int(abortIndex) {
panic("too many handlers")
}
assert1(finalSize < int(abortIndex), "too many handlers")
mergedHandlers := make(HandlersChain, finalSize)
copy(mergedHandlers, group.Handlers)
copy(mergedHandlers[len(group.Handlers):], handlers)
Expand Down

0 comments on commit f96678c

Please sign in to comment.