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 (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"fmt"
|
||||||
"html/template"
|
"html/template"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"fmt"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const ginSupportMinGoVer = 6
|
const ginSupportMinGoVer = 6
|
||||||
|
2
gin.go
2
gin.go
@ -5,12 +5,12 @@
|
|||||||
package gin
|
package gin
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"html/template"
|
"html/template"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/gin-gonic/gin/render"
|
"github.com/gin-gonic/gin/render"
|
||||||
)
|
)
|
||||||
|
6
tree.go
6
tree.go
@ -94,7 +94,6 @@ type node struct {
|
|||||||
nType nodeType
|
nType nodeType
|
||||||
maxParams uint8
|
maxParams uint8
|
||||||
wildChild bool
|
wildChild bool
|
||||||
allPath string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// increments priority of the given child and reorders if necessary.
|
// 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,
|
indices: n.indices,
|
||||||
children: n.children,
|
children: n.children,
|
||||||
handlers: n.handlers,
|
handlers: n.handlers,
|
||||||
allPath:path,
|
|
||||||
priority: n.priority - 1,
|
priority: n.priority - 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,7 +168,6 @@ func (n *node) addRoute(path string, handlers HandlersChain) {
|
|||||||
n.indices = string([]byte{n.path[i]})
|
n.indices = string([]byte{n.path[i]})
|
||||||
n.path = path[:i]
|
n.path = path[:i]
|
||||||
n.handlers = nil
|
n.handlers = nil
|
||||||
n.allPath=path
|
|
||||||
n.wildChild = false
|
n.wildChild = false
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,14 +235,12 @@ func (n *node) addRoute(path string, handlers HandlersChain) {
|
|||||||
n = child
|
n = child
|
||||||
}
|
}
|
||||||
n.insertChild(numParams, path, fullPath, handlers)
|
n.insertChild(numParams, path, fullPath, handlers)
|
||||||
n.allPath=path
|
|
||||||
return
|
return
|
||||||
|
|
||||||
} else if i == len(path) { // Make node a (in-path) leaf
|
} else if i == len(path) { // Make node a (in-path) leaf
|
||||||
if n.handlers != nil {
|
if n.handlers != nil {
|
||||||
panic("handlers are already registered for path '" + fullPath + "'")
|
panic("handlers are already registered for path '" + fullPath + "'")
|
||||||
}
|
}
|
||||||
n.allPath=path
|
|
||||||
n.handlers = handlers
|
n.handlers = handlers
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@ -253,7 +248,6 @@ func (n *node) addRoute(path string, handlers HandlersChain) {
|
|||||||
} else { // Empty tree
|
} else { // Empty tree
|
||||||
n.insertChild(numParams, path, fullPath, handlers)
|
n.insertChild(numParams, path, fullPath, handlers)
|
||||||
n.nType = root
|
n.nType = root
|
||||||
n.allPath=path
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user