golang The system cannot find the path specified.

前端之家收集整理的这篇文章主要介绍了golang The system cannot find the path specified.前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

指定的路径有误

package main

import (
   "net/http"
   "fmt"
   "strings"
   "log"
   "html/template"
)

func @H_404_19@sayHelloName(w http.ResponseWriter,r *http.Request)  {
   r.@H_404_19@ParseForm();
   fmt.@H_404_19@Println(r.Form)
   fmt.@H_404_19@Println(r.URL.Path)
   fmt.@H_404_19@Println(r.URL.Scheme)
   fmt.@H_404_19@Println(r.Form["url_long"])
   for k,v:= range r.Form{
      fmt.@H_404_19@Println("key: ",k)
      fmt.@H_404_19@Println("value:",strings.@H_404_19@Join(v,""))
   }
   fmt.@H_404_19@Fprintln(w,"hello nihao")

}

func @H_404_19@login(w http.ResponseWriter,r *http.Request)  {
   fmt.@H_404_19@Println("method: ",r.Method)
   if r.Method == "GET" {
      t,err := template.@H_404_19@ParseFiles("src/html/login.gtpl")
      if err != nil {
         fmt.@H_404_19@Println(err)
         return
      }
      t.@H_404_19@Execute(w,nil)
   } else {
      fmt.@H_404_19@Println("username: ",r.Form["username"])
      fmt.@H_404_19@Println("password: ",r.Form["password"])
   }
}
func @H_404_19@main()  {
   //http.HandleFunc("/",sayHelloName);
   http.@H_404_19@HandleFunc("/login",@H_404_19@login)
   err:= http.@H_404_19@ListenAndServe(":9090",nil)
   if err != nil {
      log.@H_404_19@Fatalf("Listen and server",err)
   }
}

猜你在找的Go相关文章