-
Notifications
You must be signed in to change notification settings - Fork 285
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What needs to be changed? Describe the update that is required.
文档中middleware.go默认模版和源代码不一致
What is the name + path of the page that needs changed? The relative path
and page title where you found a problem.
这是cloudwego中middleware.go的模版:
{{define "M"}}
func {{.MiddleWare}}Mw() []app.HandlerFunc {
// your code...
return nil
}
{{range $_, $router := $.Children}}{{template "M" $router}}{{end}}
{{- end}}
{{template "M" .Router}}
这是Hertz源码中的默认模版:
{{define "M"}}
{{- if ne .Children.Len 0}}
func {{.GroupMiddleware}}Mw() []app.HandlerFunc {
// your code...
return nil
}
{{end}}
{{- if ne .Handler ""}}
func {{.HandlerMiddleware}}Mw() []app.HandlerFunc {
// your code...
return nil
}
{{end}}
{{range $_, $router := $.Children}}{{template "M" $router}}{{end}}
{{- end}}
{{template "M" .Router}}
router.go的模版也有类似的问题
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working