Addr returns the bound listener address. Useful when Start was called with ":0" — the kernel picks a port and tests need to discover which.
()
| 107 | // called with ":0" — the kernel picks a port and tests need to |
| 108 | // discover which. |
| 109 | func (s *Server) Addr() string { |
| 110 | if s.listener == nil { |
| 111 | return s.addr |
| 112 | } |
| 113 | return s.listener.Addr().String() |
| 114 | } |
| 115 | |
| 116 | // Stop is idempotent. |
| 117 | func (s *Server) Stop() { |