I was reading the type declaration for http.Server
in the documentation and I came across this.
type Server struct {
Addr string // TCP address to listen on, ":http" if empty
// more...
}
If you call srv.ListenAndServe()
and srv.Addr
is an empty string, then ListenAndServe
will pass ":http"
to net.Listen
(http/server.go).
What does ":http"
mean?