2015-07-22 10 views
6

Stavo leggendo la dichiarazione del tipo per http.Server nella documentazione e mi sono imbattuto in questo.Cosa significa port ": http" in http.Server?

type Server struct { 
    Addr string // TCP address to listen on, ":http" if empty 
    // more... 
} 

Se si chiama srv.ListenAndServe() e srv.Addr è una stringa vuota, allora ListenAndServe passerà ":http" a net.Listen (http/server.go).

Che cosa significa ":http"?

risposta