Update readme.md
This commit is contained in:
parent
d79ed15728
commit
6cd5deb884
1 changed files with 5 additions and 2 deletions
|
@ -64,6 +64,8 @@ grp.StopAndWait()
|
|||
|
||||
## Example
|
||||
|
||||
### Structure
|
||||
|
||||
```
|
||||
type Server struct {
|
||||
grp *stop.Group
|
||||
|
@ -112,10 +114,11 @@ func (s *Server) Start(address string) error {
|
|||
// listenAndServe blocks until the server is shut down, just like http.ListenAndServe()
|
||||
return s.listenAndServe(l)
|
||||
}
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
// how this is used
|
||||
|
||||
```
|
||||
s := NewServer()
|
||||
log.Println("starting")
|
||||
go s.Start("localhost:1234")
|
||||
|
|
Loading…
Add table
Reference in a new issue