From 17f1add33cedc24f83d52f6b00963b526e1be4e2 Mon Sep 17 00:00:00 2001 From: Marcus Franke Date: Wed, 2 Nov 2016 10:52:31 +0100 Subject: [PATCH] Changed example sources according to the basic documentation example --- examples/random/main.go | 3 ++- examples/simple/main.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/random/main.go b/examples/random/main.go index 5639571..955b21b 100644 --- a/examples/random/main.go +++ b/examples/random/main.go @@ -18,6 +18,7 @@ package main import ( "flag" + "log" "math" "math/rand" "net/http" @@ -99,5 +100,5 @@ func main() { // Expose the registered metrics via HTTP. http.Handle("/metrics", prometheus.Handler()) - http.ListenAndServe(*addr, nil) + log.Fatal(http.ListenAndServe(*addr, nil)) } diff --git a/examples/simple/main.go b/examples/simple/main.go index 19620d2..47f57ca 100644 --- a/examples/simple/main.go +++ b/examples/simple/main.go @@ -16,6 +16,7 @@ package main import ( "flag" + "log" "net/http" "github.com/prometheus/client_golang/prometheus" @@ -26,5 +27,5 @@ var addr = flag.String("listen-address", ":8080", "The address to listen on for func main() { flag.Parse() http.Handle("/metrics", prometheus.Handler()) - http.ListenAndServe(*addr, nil) + log.Fatal(http.ListenAndServe(*addr, nil)) }