From 1228b03914ac7ec8f9ba8c17f599863b0e1883ea Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Sun, 31 May 2015 18:35:28 +0200 Subject: [PATCH] Fixing some unit tests --- context.go | 2 +- routergroup.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/context.go b/context.go index c04cd1d..5ff915d 100644 --- a/context.go +++ b/context.go @@ -28,7 +28,7 @@ const ( MIMEMultipartPOSTForm = binding.MIMEMultipartPOSTForm ) -const AbortIndex = math.MaxInt8 / 2 +const AbortIndex int8 = math.MaxInt8 / 2 // Context is the most important part of gin. It allows us to pass variables between middleware, // manage the flow, validate the JSON of a request and render a JSON response for example. diff --git a/routergroup.go b/routergroup.go index de40d17..ff6b40b 100644 --- a/routergroup.go +++ b/routergroup.go @@ -148,7 +148,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 >= AbortIndex { + if finalSize >= int(AbortIndex) { panic("too many handlers") } mergedHandlers := make(HandlersChain, finalSize)