Update to new goprogram version

This commit is contained in:
Tom Wiesing 2023-11-01 22:01:24 +01:00
parent 7bd9570bc0
commit 873fdcd5c2
No known key found for this signature in database
106 changed files with 478 additions and 825 deletions

View file

@ -40,7 +40,7 @@ type RuntimeFlags struct {
CSRF template.HTML // csrf data (if any)
}
var runtimeFlagsName = reflectx.MakeType[RuntimeFlags]().Name()
var runtimeFlagsName = reflectx.TypeFor[RuntimeFlags]().Name()
// Clone clones this flags
func (flags Flags) Clone() Flags {

View file

@ -18,7 +18,7 @@ func (tpl *Templating) buildMenu(r *http.Request) []component.MenuItem {
// get the static menu items, and then return all the regular ones
var items []component.MenuItem
for _, m := range tpl.Dependencies.Menuable {
for _, m := range tpl.dependencies.Menuable {
items = append(items, m.Menu(r)...)
}
for i, item := range items {
@ -31,8 +31,8 @@ func (tpl *Templating) buildMenu(r *http.Request) []component.MenuItem {
// Menu returns a list of menu items provided by routeables
func (tpl *Templating) Menu(r *http.Request) []component.MenuItem {
return tpl.menu.Get(func() []component.MenuItem {
items := make([]component.MenuItem, 0, len(tpl.Dependencies.Routeables))
for _, route := range tpl.Dependencies.Routeables {
items := make([]component.MenuItem, 0, len(tpl.dependencies.Routeables))
for _, route := range tpl.dependencies.Routeables {
routes := route.Routes()
if routes.MenuTitle == "" {
continue

View file

@ -21,7 +21,7 @@ type Parsed[C any] struct {
// If base is not nil, every template associated with the base template is copied into the given template.
// Functions will be applied on creation time to represent the context for the given template.
func Parse[C any](name string, source []byte, base *template.Template, funcs ...FlagFunc) Parsed[C] {
tp := reflectx.MakeType[C]()
tp := reflectx.TypeFor[C]()
// determine if we have an embedded field in the struct
var hasEmbed bool

View file

@ -8,7 +8,7 @@ import (
// Templating implements templating customization
type Templating struct {
component.Base
Dependencies struct {
dependencies struct {
Routeables []component.Routeable
Menuable []component.Menuable
}