Close stops all listeners of PortForwarder.
()
| 403 | |
| 404 | // Close stops all listeners of PortForwarder. |
| 405 | func (pf *PortForwarder) Close() { |
| 406 | // stop all listeners |
| 407 | for _, l := range pf.listeners { |
| 408 | if err := l.Close(); err != nil { |
| 409 | runtime.HandleError(fmt.Errorf("error closing listener: %v", err)) |
| 410 | } |
| 411 | } |
| 412 | } |
| 413 | |
| 414 | // GetPorts will return the ports that were forwarded; this can be used to |
| 415 | // retrieve the locally-bound port in cases where the input was port 0. This |
no test coverage detected