mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-16 05:16:35 +08:00
fix: With(opts...)
must be after New
This commit is contained in:
parent
8f70ecb911
commit
4f8917a310
3
gin.go
3
gin.go
@ -221,8 +221,9 @@ func New(opts ...OptionFunc) *Engine {
|
||||
// Default returns an Engine instance with the Logger and Recovery middleware already attached.
|
||||
func Default(opts ...OptionFunc) *Engine {
|
||||
debugPrintWARNINGDefault()
|
||||
engine := New(opts...)
|
||||
engine := New()
|
||||
engine.Use(Logger(), Recovery())
|
||||
engine.With(opts...)
|
||||
return engine
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user