forked from mirror/gin
use assert1 func (#2783)
This commit is contained in:
parent
3116a2d7a1
commit
f96678cb6b
|
@ -214,9 +214,7 @@ func (group *RouterGroup) createStaticHandler(relativePath string, fs http.FileS
|
||||||
|
|
||||||
func (group *RouterGroup) combineHandlers(handlers HandlersChain) HandlersChain {
|
func (group *RouterGroup) combineHandlers(handlers HandlersChain) HandlersChain {
|
||||||
finalSize := len(group.Handlers) + len(handlers)
|
finalSize := len(group.Handlers) + len(handlers)
|
||||||
if finalSize >= int(abortIndex) {
|
assert1(finalSize < int(abortIndex), "too many handlers")
|
||||||
panic("too many handlers")
|
|
||||||
}
|
|
||||||
mergedHandlers := make(HandlersChain, finalSize)
|
mergedHandlers := make(HandlersChain, finalSize)
|
||||||
copy(mergedHandlers, group.Handlers)
|
copy(mergedHandlers, group.Handlers)
|
||||||
copy(mergedHandlers[len(group.Handlers):], handlers)
|
copy(mergedHandlers[len(group.Handlers):], handlers)
|
||||||
|
|
Loading…
Reference in New Issue