From f45c83c70cb27a16d3cae220afff2a731ea4f707 Mon Sep 17 00:00:00 2001 From: bullgare Date: Mon, 23 Sep 2019 18:48:10 +0300 Subject: [PATCH] Updated Readme.md for serving multiple services (#2067) Previous version had issues - if one service did not start for any reason, you would never know about it. --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b488f15..dfedd8a 100644 --- a/README.md +++ b/README.md @@ -1678,11 +1678,19 @@ func main() { } g.Go(func() error { - return server01.ListenAndServe() + err := server01.ListenAndServe() + if err != nil && err != http.ErrServerClosed { + log.Fatal(err) + } + return err }) g.Go(func() error { - return server02.ListenAndServe() + err := server02.ListenAndServe() + if err != nil && err != http.ErrServerClosed { + log.Fatal(err) + } + return err }) if err := g.Wait(); err != nil {