From 6dac8c8a486dab63a4198e8421a2ae6a263129b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=94=B0=E6=AC=A7?= <thinkerou@gmail.com>
Date: Tue, 13 Jun 2017 11:36:05 +0800
Subject: [PATCH] delete else keyword (#948)

---
 gin.go  | 4 ++--
 tree.go | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/gin.go b/gin.go
index dcca2b3d..992d2f15 100644
--- a/gin.go
+++ b/gin.go
@@ -326,8 +326,8 @@ func (engine *Engine) handleHTTPRequest(context *Context) {
 				context.Next()
 				context.writermem.WriteHeaderNow()
 				return
-
-			} else if httpMethod != "CONNECT" && path != "/" {
+			}
+			if httpMethod != "CONNECT" && path != "/" {
 				if tsr && engine.RedirectTrailingSlash {
 					redirectTrailingSlash(context)
 					return
diff --git a/tree.go b/tree.go
index 98bb9cdb..d8aa3127 100644
--- a/tree.go
+++ b/tree.go
@@ -432,7 +432,8 @@ walk: // Outer loop for walking the tree
 
 					if handlers = n.handlers; handlers != nil {
 						return
-					} else if len(n.children) == 1 {
+					}
+					if len(n.children) == 1 {
 						// No handle found. Check if a handle for this path + a
 						// trailing slash exists for TSR recommendation
 						n = n.children[0]