docs: small changes (#4261)

This commit is contained in:
eqsdxr 2025-06-09 18:04:23 +05:00 committed by GitHub
parent e30123ad73
commit a9c5b36578
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

4
gin.go
View File

@ -334,7 +334,7 @@ func (engine *Engine) Use(middleware ...HandlerFunc) IRoutes {
return engine return engine
} }
// With returns a Engine with the configuration set in the OptionFunc. // With returns an Engine with the configuration set in the OptionFunc.
func (engine *Engine) With(opts ...OptionFunc) *Engine { func (engine *Engine) With(opts ...OptionFunc) *Engine {
for _, opt := range opts { for _, opt := range opts {
opt(engine) opt(engine)
@ -376,7 +376,7 @@ func (engine *Engine) addRoute(method, path string, handlers HandlersChain) {
} }
// Routes returns a slice of registered routes, including some useful information, such as: // Routes returns a slice of registered routes, including some useful information, such as:
// the http method, path and the handler name. // the http method, path, and the handler name.
func (engine *Engine) Routes() (routes RoutesInfo) { func (engine *Engine) Routes() (routes RoutesInfo) {
for _, tree := range engine.trees { for _, tree := range engine.trees {
routes = iterate("", tree.method, routes, tree.root) routes = iterate("", tree.method, routes, tree.root)