chore: simplify
This commit is contained in:
parent
dc4f80b055
commit
3b101279ef
1 changed files with 3 additions and 7 deletions
|
|
@ -34,13 +34,9 @@ func templatesHandler(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
// filter deprecated properties
|
||||
filterParams := func(t templates.Template) templates.Template {
|
||||
params := make([]templates.Param, 0, len(t.Params))
|
||||
for _, p := range t.Params {
|
||||
if p.Deprecated == nil || !*p.Deprecated {
|
||||
params = append(params, p)
|
||||
}
|
||||
}
|
||||
t.Params = params
|
||||
t.Params = slices.DeleteFunc(t.Params, func(p templates.Param) bool {
|
||||
return p.Deprecated != nil && *p.Deprecated
|
||||
})
|
||||
return t
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue