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"
?
Nota: che è stato introdotto in [commettere 876e9d1b] (https://github.com/golang/go/commit/876e9d1b89cf87f3791153fa9472142cd5294223#diff-21335be6bb7e87c8e655a237f635b095R679) nel febbraio 2011 da [Brad Fitzpatrick] (https://github.com/bradfitz). – VonC