Skip to content

Instantly share code, notes, and snippets.

@sunfmin
Created March 22, 2013 06:30
Show Gist options
  • Save sunfmin/5219401 to your computer and use it in GitHub Desktop.
Save sunfmin/5219401 to your computer and use it in GitHub Desktop.
func Hello(w io.Writer, d *HelloData) (err error) {
_, err = io.WriteString(w, "<h1>")
if err != nil {
return
}
_, err = io.WriteString(w, fmt.Sprintf("Hi, %s", d.Name))
if err != nil {
return
}
_, err = io.WriteString(w, " ")
if err != nil {
return
}
err = d.MyEmail(w)
if err != nil {
return
}
_, err = io.WriteString(w, "</h1>\n")
if err != nil {
return
}
_, err = io.WriteString(w, "<ul>\n")
if err != nil {
return
}
for _, e := range d.Entries {
_, err = io.WriteString(w, "<li>")
if err != nil {
return
}
err = EntryItem(w, e, d.Lang)
if err != nil {
return
}
_, err = io.WriteString(w, "</li>\n")
if err != nil {
return
}
}
_, err = io.WriteString(w, "</ul>\n")
if err != nil {
return
}
return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment