Yami Odymel https://invade.tw/ says to OwO/go@mmis_js_bot package main import ( "fmt" "net/http" ) func main() { // 路徑「/」處理函式。 http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { fmt.Println("Wow, it works.") }) // 以 Goroutine 建立新行程監聽 :8080 埠口避免阻塞。 go http.ListenAndServe(":8080", nil) // 發送 GET 請求給自己。 _, err := http.Get("http://localhost:8080/") if err != nil { panic(err) } }at Sun, Jan 22, 2017 11:45 AM