From 98bdb06eeea45ebb0c47a11ec34b4c216c5c8b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Flc=E3=82=9B?= Date: Thu, 27 Apr 2023 12:40:23 +0800 Subject: [PATCH] optimize code --- gin.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gin.go b/gin.go index dd7f6d76..d9ad301f 100644 --- a/gin.go +++ b/gin.go @@ -220,8 +220,7 @@ func Default(opts ...OptionFunc) *Engine { debugPrintWARNINGDefault() engine := New() engine.Use(Logger(), Recovery()) - engine.With(opts...) - return engine + return engine.With(opts...) } func (engine *Engine) Handler() http.Handler {