Skip to content

Commit eaee308

Browse files
committed
fix examples with latest types
1 parent 1dae00c commit eaee308

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/server.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func rootHandler(w http.ResponseWriter, r *http.Request) {
2929
"rel": "stylesheet",
3030
})
3131

32-
meta := []func() string{
32+
meta := []HTML{
3333
H("meta", Attr{"charset": "UTF-8"}),
3434
H("meta", Attr{
3535
"name": "viewport",
@@ -49,9 +49,9 @@ func rootHandler(w http.ResponseWriter, r *http.Request) {
4949
w.Write([]byte(html()))
5050
}
5151

52-
func navItems(user User) []func() string {
52+
func navItems(user User) []HTML {
5353
// get itmes from somewhere such as a database
54-
items := []func() string{H("li", "item one"), H("li", "item two")}
54+
items := []HTML{H("li", "item one"), H("li", "item two")}
5555

5656
// example runtime modification
5757
lastElement := H("li", user.Name)
@@ -60,7 +60,7 @@ func navItems(user User) []func() string {
6060
}
6161

6262
// AppComponent is a daz component. It returns a daz.H func
63-
func AppComponent(user User, description string) func() string {
63+
func AppComponent(user User, description string) HTML {
6464
nav := H("nav", navItems(user))
6565
return H(
6666
"div", Attr{"class": "bg-grey-50"},

0 commit comments

Comments
 (0)