mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-16 05:16:35 +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 {
|
||||
return engine.allocateContext(engine.maxParams)
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(engine)
|
||||
}
|
||||
return engine
|
||||
return engine.With(opts...)
|
||||
}
|
||||
|
||||
// Default returns an Engine instance with the Logger and Recovery middleware already attached.
|
||||
|
Loading…
x
Reference in New Issue
Block a user