Use 'localhost' explicitly to avoid warnings on Windows

This commit is contained in:
Hajime Hoshi 2017-08-18 02:30:46 +09:00
parent ab269c621b
commit 1361383ef4
2 changed files with 2 additions and 2 deletions

View File

@ -40,5 +40,5 @@ func init() {
func main() {
http.Handle("/", http.FileServer(http.Dir(rootPath)))
fmt.Printf("http://localhost:%d/\n", *port)
log.Fatal(http.ListenAndServe(":"+strconv.Itoa(*port), nil))
log.Fatal(http.ListenAndServe("localhost:"+strconv.Itoa(*port), nil))
}

View File

@ -162,5 +162,5 @@ func main() {
http.HandleFunc("/main.js.map", serveMainJSMap)
http.HandleFunc("/", serveFileHandle)
fmt.Printf("http://localhost:%d/\n", *port)
log.Fatal(http.ListenAndServe(":"+strconv.Itoa(*port), nil))
log.Fatal(http.ListenAndServe("localhost:"+strconv.Itoa(*port), nil))
}