func index(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { name := ps.ByName("name") if name == "" { name = "Unknown" } fmt.Fprint(w, helloworld.Hello(name)) }
func index(w http.ResponseWriter, r *http.Request) { name := r.FormValue("name") if name == "" { name = "Unknown" } fmt.Fprintln(w, helloworld.Hello(name)) }
func main() { fmt.Println(helloworld.Hello("go")) }