From 82e181cb6566a8ca8043b5a3b9b4e271784286b8 Mon Sep 17 00:00:00 2001 From: Francesc Campoy Date: Tue, 28 Feb 2017 16:14:35 +0530 Subject: [PATCH] Do not ignore the error coming from http.ListenAndServe in examples --- README.md | 4 ++-- examples/main.go | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f26381fe543..a139a519930 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,7 @@ Make sure that your `$GOPATH/bin` is in your `$PATH`. Now you need to write an entrypoint of the proxy server. ```go package main + import ( "flag" "net/http" @@ -158,8 +159,7 @@ Make sure that your `$GOPATH/bin` is in your `$PATH`. return err } - http.ListenAndServe(":8080", mux) - return nil + return http.ListenAndServe(":8080", mux) } func main() { diff --git a/examples/main.go b/examples/main.go index 748ab36186b..f6a16a808ce 100644 --- a/examples/main.go +++ b/examples/main.go @@ -96,8 +96,7 @@ func Run(address string, opts ...runtime.ServeMuxOption) error { } mux.Handle("/", gw) - http.ListenAndServe(address, allowCORS(mux)) - return nil + return http.ListenAndServe(address, allowCORS(mux)) } func main() {