better syntax ideas

This commit is contained in:
Jeff Carr 2025-03-18 15:14:50 -05:00
parent 7e1804f6e3
commit b4a15ef947
1 changed files with 10 additions and 0 deletions

10
init.go
View File

@ -13,6 +13,16 @@ import (
"go.wit.com/log"
)
/* better syntax from gin
Default returns an Engine instance with the Logger and Recovery middleware already attached.
func Default(opts ...OptionFunc) *Engine {
debugPrintWARNINGDefault()
engine := New()
engine.Use(Logger(), Recovery())
return engine.With(opts...)
}
*/
// todo: use initOnce
// cache.go has Do()
// f.initOnce.Do(f.initWork)