Created
March 22, 2013 06:30
-
-
Save sunfmin/5219401 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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