Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func viewHandler(w http.ResponseWriter, r *http.Request) {
- title := r.URL.Path[len("/view/"):]
- p, _ := loadPage(title)
- fmt.Printf(w, "<h1>%s</h1><div>%s</div>", p.Title, p.Body)
- }
- ----
- Gives error:
- cannot use w (type http.ResponseWriter) as type string in argument to fmt.Printf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement