format code,Remove useless code

This commit is contained in:
王守虎 2019-02-15 15:15:06 +08:00
parent f364636816
commit edc547beaa
3 changed files with 2 additions and 8 deletions

View File

@ -6,12 +6,12 @@ package gin
import (
"bytes"
"fmt"
"html/template"
"os"
"runtime"
"strconv"
"strings"
"fmt"
)
const ginSupportMinGoVer = 6

2
gin.go
View File

@ -5,12 +5,12 @@
package gin
import (
"fmt"
"html/template"
"net"
"net/http"
"os"
"sync"
"fmt"
"github.com/gin-gonic/gin/render"
)

View File

@ -94,7 +94,6 @@ type node struct {
nType nodeType
maxParams uint8
wildChild bool
allPath string
}
// increments priority of the given child and reorders if necessary.
@ -154,7 +153,6 @@ func (n *node) addRoute(path string, handlers HandlersChain) {
indices: n.indices,
children: n.children,
handlers: n.handlers,
allPath:path,
priority: n.priority - 1,
}
@ -170,7 +168,6 @@ func (n *node) addRoute(path string, handlers HandlersChain) {
n.indices = string([]byte{n.path[i]})
n.path = path[:i]
n.handlers = nil
n.allPath=path
n.wildChild = false
}
@ -238,14 +235,12 @@ func (n *node) addRoute(path string, handlers HandlersChain) {
n = child
}
n.insertChild(numParams, path, fullPath, handlers)
n.allPath=path
return
} else if i == len(path) { // Make node a (in-path) leaf
if n.handlers != nil {
panic("handlers are already registered for path '" + fullPath + "'")
}
n.allPath=path
n.handlers = handlers
}
return
@ -253,7 +248,6 @@ func (n *node) addRoute(path string, handlers HandlersChain) {
} else { // Empty tree
n.insertChild(numParams, path, fullPath, handlers)
n.nType = root
n.allPath=path
}
}