mirror of
https://github.com/mmatczuk/go-http-tunnel.git
synced 2026-05-15 14:16:17 -06:00
avoid panic in runtime
This commit is contained in:
parent
d364f66c09
commit
54b9f0cd4a
6 changed files with 41 additions and 28 deletions
|
|
@ -59,16 +59,16 @@ type Client struct {
|
|||
// must invoke Start() on returned instance in order to connect server.
|
||||
func NewClient(config *ClientConfig) *Client {
|
||||
if config.ServerAddr == "" {
|
||||
panic("Missing ServerAddr")
|
||||
panic("missing ServerAddr")
|
||||
}
|
||||
if config.TLSClientConfig == nil {
|
||||
panic("Missing TLSClientConfig")
|
||||
panic("missing TLSClientConfig")
|
||||
}
|
||||
if config.Tunnels == nil || len(config.Tunnels) == 0 {
|
||||
panic("Missing Tunnels")
|
||||
panic("missing Tunnels")
|
||||
}
|
||||
if config.Proxy == nil {
|
||||
panic("Missing Proxy")
|
||||
panic("missing Proxy")
|
||||
}
|
||||
|
||||
logger := config.Logger
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue