rename variable

This commit is contained in:
Alexandr Emelin 2017-08-04 16:59:29 +03:00 committed by GitHub
parent c92b168ae0
commit 409296e009

View File

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