fix: gofumpt issue in gin.go

This commit is contained in:
pawannn 2025-11-10 00:09:46 +05:30
parent 19e33ded6c
commit 0771735cd7

16
gin.go
View File

@ -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)