Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "io"
- "net/http"
- )
- func main() {
- http.HandleFunc("/", foo)
- http.Handle("/favicon.ico", http.NotFoundHandler())
- http.ListenAndServe(":8080", nil)
- }
- func foo(w http.ResponseWriter, req *http.Request) {
- v := req.FormValue("q")
- w.Header().Set("Content-Type", "text/html; charset=utf-8")
- io.WriteString(w, `
- <form method="post">
- <input type="text" name="q">
- <input type="submit">
- </form>
- <br>`+v)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement