mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-16 13:22:09 +08:00
feat: improve New with
This commit is contained in:
parent
4f8917a310
commit
a12c553ba0
5
gin.go
5
gin.go
@ -212,10 +212,7 @@ func New(opts ...OptionFunc) *Engine {
|
|||||||
engine.pool.New = func() any {
|
engine.pool.New = func() any {
|
||||||
return engine.allocateContext(engine.maxParams)
|
return engine.allocateContext(engine.maxParams)
|
||||||
}
|
}
|
||||||
for _, opt := range opts {
|
return engine.With(opts...)
|
||||||
opt(engine)
|
|
||||||
}
|
|
||||||
return engine
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default returns an Engine instance with the Logger and Recovery middleware already attached.
|
// Default returns an Engine instance with the Logger and Recovery middleware already attached.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user