forked from mirror/gin
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.
This commit is contained in:
parent
0b96dd8ae5
commit
f45c83c70c
12
README.md
12
README.md
|
@ -1678,11 +1678,19 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
g.Go(func() error {
|
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 {
|
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 {
|
if err := g.Wait(); err != nil {
|
||||||
|
|
Loading…
Reference in New Issue