golang如何关闭http 端口

package main

import (

"io"
"net/http"

)

func main() {

http.HandleFunc("/", hello)
http.ListenAndServe(":8080", nil)

}

func hello(w http.ResponseWriter, r *http.Request) {

io.WriteString(w, "你好啊世界")

}

阅读 4.9k
1 个回答
推荐问题
宣传栏