我正在阅读http.Server文档中的类型声明,我遇到了这个.
type Server struct {
Addr string // TCP address to listen on, ":http" if empty
// more...
}
Run Code Online (Sandbox Code Playgroud)
如果你调用srv.ListenAndServe()并且srv.Addr是一个空字符串,那么ListenAndServe将传递":http"给net.Listen(http/server.go).
什么":http"意思?