mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-22 17:42:14 +08:00
format code,Remove useless code
This commit is contained in:
parent
f364636816
commit
edc547beaa
2
debug.go
2
debug.go
@ -6,12 +6,12 @@ package gin
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"os"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
const ginSupportMinGoVer = 6
|
||||
|
2
gin.go
2
gin.go
@ -5,12 +5,12 @@
|
||||
package gin
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"html/template"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"sync"
|
||||
"fmt"
|
||||
|
||||
"github.com/gin-gonic/gin/render"
|
||||
)
|
||||
|
6
tree.go
6
tree.go
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user