Merge pull request #1 from FZambia/patch-1

rename variable port to addr
This commit is contained in:
Alexander Zhebrak 2017-08-05 10:05:26 +03:00 committed by GitHub
commit 5972087e93

View File

@ -53,13 +53,13 @@ func metrics(response http.ResponseWriter, request *http.Request) {
} }
func main() { func main() {
port := ":9101" addr := ":9101"
if len(os.Args) > 1 { if len(os.Args) > 1 {
port = ":" + os.Args[1] addr = ":" + os.Args[1]
} }
http.HandleFunc("/metrics/", metrics) http.HandleFunc("/metrics/", metrics)
err := http.ListenAndServe(port, nil) err := http.ListenAndServe(addr, nil)
if err != nil { if err != nil {
log.Fatal("ListenAndServe: ", err) log.Fatal("ListenAndServe: ", err)
} }