From a12c553ba0f2986226f9013de8f7f9fec56e56ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Flc=E3=82=9B?= Date: Wed, 19 Apr 2023 11:16:26 +0800 Subject: [PATCH] feat: improve New with --- gin.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gin.go b/gin.go index c7cb61bc..7107c3dc 100644 --- a/gin.go +++ b/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.