package counter import "fmt" func urlFor(who, what, dir string) string { return fmt.Sprintf("/counter/users/%s/items/%s/%s", who, what, dir) } func (p *CounterPlugin) allItems() map[string][]Item { items, err := GetAllItemsByUser(p.db) if err != nil { return map[string][]Item{"error": []Item{}} } return items } templ (p *CounterPlugin) index() {

Counter

Password
for user, items := range p.allItems() { for _, thing := range items { @p.renderItem(user, thing) } }
{ user }
} templ (p *CounterPlugin) renderItem(user string, item Item) { { item.Item } { fmt.Sprintf("%d", item.Count) } }