MCPcopy
hub / github.com/gin-gonic/gin / Default

Function Default

gin.go:236–241  ·  view source on GitHub ↗

Default returns an Engine instance with the Logger and Recovery middleware already attached.

(opts ...OptionFunc)

Source from the content-addressed store, hash-verified

234
235// Default returns an Engine instance with the Logger and Recovery middleware already attached.
236func Default(opts ...OptionFunc) *Engine {
237 debugPrintWARNINGDefault()
238 engine := New()
239 engine.Use(Logger(), Recovery())
240 return engine.With(opts...)
241}
242
243func (engine *Engine) Handler() http.Handler {
244 if !engine.UseH2C {

Callers 6

gins.goFile · 0.92
TestRaceContextCopyFunction · 0.70
TestH2cFunction · 0.70
TestCreateDefaultRouterFunction · 0.70

Calls 6

debugPrintWARNINGDefaultFunction · 0.85
NewFunction · 0.85
LoggerFunction · 0.85
RecoveryFunction · 0.85
WithMethod · 0.80
UseMethod · 0.65

Tested by 5

TestRaceContextCopyFunction · 0.56
TestH2cFunction · 0.56
TestCreateDefaultRouterFunction · 0.56