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() {