我正在阅读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"
意思?
归档时间: |
|
查看次数: |
145 次 |
最近记录: |