mirror of
https://github.com/gin-gonic/gin.git
synced 2025-12-13 13:12:17 +08:00
fix: gofumpt issue in gin.go
This commit is contained in:
parent
19e33ded6c
commit
0771735cd7
16
gin.go
16
gin.go
@ -23,10 +23,12 @@ import (
|
|||||||
"golang.org/x/net/http2/h2c"
|
"golang.org/x/net/http2/h2c"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultMultipartMemory = 32 << 20 // 32 MB
|
const (
|
||||||
const escapedColon = "\\:"
|
defaultMultipartMemory = 32 << 20 // 32 MB
|
||||||
const colon = ":"
|
escapedColon = "\\:"
|
||||||
const backslash = "\\"
|
colon = ":"
|
||||||
|
backslash = "\\"
|
||||||
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
default404Body = []byte("404 page not found")
|
default404Body = []byte("404 page not found")
|
||||||
@ -46,8 +48,10 @@ var defaultTrustedCIDRs = []*net.IPNet{
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var regSafePrefix = regexp.MustCompile("[^a-zA-Z0-9/-]+")
|
var (
|
||||||
var regRemoveRepeatedChar = regexp.MustCompile("/{2,}")
|
regSafePrefix = regexp.MustCompile("[^a-zA-Z0-9/-]+")
|
||||||
|
regRemoveRepeatedChar = regexp.MustCompile("/{2,}")
|
||||||
|
)
|
||||||
|
|
||||||
// HandlerFunc defines the handler used by gin middleware as return value.
|
// HandlerFunc defines the handler used by gin middleware as return value.
|
||||||
type HandlerFunc func(*Context)
|
type HandlerFunc func(*Context)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user