Bladeren bron

reduce go cyclo (#1076)

* reduce go cyclo

* use := var
田欧 8 jaren geleden
bovenliggende
commit
c25254f563
1 gewijzigde bestanden met toevoegingen van 2 en 5 verwijderingen
  1. 2 5
      gin.go

+ 2 - 5
gin.go

@@ -316,14 +316,11 @@ func (engine *Engine) HandleContext(c *Context) {
 
 
 func (engine *Engine) handleHTTPRequest(context *Context) {
 func (engine *Engine) handleHTTPRequest(context *Context) {
 	httpMethod := context.Request.Method
 	httpMethod := context.Request.Method
-	var path string
-	var unescape bool
+	path := context.Request.URL.Path
+	unescape := false
 	if engine.UseRawPath && len(context.Request.URL.RawPath) > 0 {
 	if engine.UseRawPath && len(context.Request.URL.RawPath) > 0 {
 		path = context.Request.URL.RawPath
 		path = context.Request.URL.RawPath
 		unescape = engine.UnescapePathValues
 		unescape = engine.UnescapePathValues
-	} else {
-		path = context.Request.URL.Path
-		unescape = false
 	}
 	}
 
 
 	// Find root of the tree for the given HTTP method
 	// Find root of the tree for the given HTTP method